August 2, 2001 at 4:30 am
How do you get the object_id of a table or any objeect on another server dynamically ?
I have tried :
select object_id("@servername.@dbname.dbo.attendance_details")
It returns NULL.
When i try to get the id without the use of variables ie.
select object_id("servername.dbname.dbo.attendance_details")
The query still returns NULL.
I am executing it in a query in a stored procedure in the following way :
select "Database Version"= syp_value, "Total Attendances" = rows
FROM servername.database.owner.systemproperties, servername.database.owner.sysindexes
where id = OBJECT_ID("servername.database.owner.Attendance_details")
AND indid < 2
AND syp_type = "Database Version"
Thanks in advance.
Edited by - pattikay on 08/02/2001 04:33:40 AM
August 2, 2001 at 6:29 am
Embed the OBJECT_ID() function in a stored procedure on the remote server, and execute the proc with the name of the object you want the id for.
Chris Hedgate @ Apptus Technologies (http://www.apptus.se)
August 3, 2001 at 4:57 am
Thanks .that's a very good idea.I will try it out.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy