Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何使用 MS sql server 中的表名和列名从 sys.sysobjects 表中检索对象 ID?
我想你正在寻找这个-
USE [DatabaseName] SELECT OBJECT_ID(N'[SchemaName].[ObjectName]',N'ObjectType')
如果你想找出一个表的对象 id,那么试试这个——
USE [DatabaseName] SELECT OBJECT_ID(N'[SchemaName].[TableName]',N'TT')
更多关于OBJECT_ID() 去这里和了解Object Type 去这里
OBJECT_ID()
Object Type