SQL数据字典:查一个表的主Key是什么?(用于SQL 2000和2005)
--for 2005
select * from sys.index_columns where object_id = object_id('MyTable')
--for 2000 and 2005
select * from sysindexkeys where id = object_id('MyTable')
参考MSDN:
http://msdn.microsoft.com/zh-cn/library/ms187997.aspx
浙公网安备 33010602011771号