SQL Server 根据表名取得 表主键

exec sp_primary_keys_rowset N'表名',NULL 
原文地址:https://www.cnblogs.com/wuyifu/p/3410343.html