While creating some generic database related userinterfaces we always have find the primary key of the table in runtime. Previously in my Code generation wizards I used to search for the first field with "Id" as suffix and give the user chance to change. But now a senario came when i had create an update command of an sqldatasource in runtime. So i had get the primary key to for specifiying the where clause.
Now I could find the "sp_pKeys" in MS-SQlServer to get the primary key
Eg:
use pubs
sp_pKeys 'authors'
Monday, May 02, 2005
How to find the Primary key of table
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment