Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Identifying the ID column

Status
Not open for further replies.

SteveMac32

Programmer
Jan 25, 2002
74
GB
Hi all,
I have created a grid and am loading it from a recordset, these values can be changed by the user and then written back to the database (SQL 7), because of this I will want to suppress the ID column is there anyway I can identify this in the stored procedure that loads the recordset an so not return it.

Many thanks

Steve

 
this should do:

select name
from syscolumns
where id = object_id('<table>')
and colstat & 1 = 1

taken from the sp_help procedure regards,
Paul
 
Thanks a lot Paul really appreciate that, it works a treat, how do you mean when you say ‘taken from the sp_help procedure’
 
The sp_help procedure, among many other things, gives the id column. The T-SQL code of sp_help can be seen either through the Enterprise Manager, or in the Query Analyzer with the command:

exec sp_helptext sp_help

in the Master database.

regards,
Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top