开发者

get table from a database using object_id

i want to get column names of table in sys.table using its object_id

regards开发者_JS百科 vivek


SELECT name
FROM sys.columns
WHERE [object_id] = OBJECT_ID(N'[dbo].[<your table name here>]')

If you know the object id, you can stick it in instead of OBJECT_ID(N'[dbo].[<your table name here>]'). Or, you could also stick a variable there.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜