One more way to get primary key details of table

One more way to get primary key details of table

EXEC sp_pkeys
    'SalesOrderDetail',
    'Sales'




'Sales.SalesOrderDetail'

Exec  sp_pkeys
@table_name,
@table_owner,
@table_qualifier

@table_name - Table Name
@table_owner - Table Owner Name Default is Null
@table_qualifier - DB Name where proc is running  Default is Null

Lets see an Exampple


EXEC sp_pkeys   'SalesOrderDetail',   'Sales'

No comments:

Post a Comment

Popular Posts