SpeedBWild
Grasshopper
Points: 11
More actions
April 27, 2004 at 7:48 am
#108168
I know if I go into sysdatabase I can find the id to a database, but how do I find an id to a table within a database?
Frank Kalis
SSC Guru
Points: 111183
April 27, 2004 at 7:59 am
#504333
Take a look at OBJECT_ID() in BOL.
--Frank KalisMicrosoft SQL Server MVPWebmaster: http://www.insidesql.org/blogsMy blog: http://www.insidesql.org/blogs/frankkalis/[/url]
Stefan Ardeleanu
Mr or Mrs. 500
Points: 501
April 27, 2004 at 8:46 am
#504348
select id from sysobjects where xtype = 'U'
and you will find all the user tables.
If the name is @name, the id of @name table will be the following:
select id from sysobjects where name = @name
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply