August 23, 2011 at 3:50 am
hi,
If I login as the schema user and excute
SELECT OBJECT_NAME(id) FROM syscolumns WHERE id=object_id('mytable')
I get a value returned.
If I then log on as SA and run the command against the same DB nothing is returned.
Why is ths?
Many thanks
August 23, 2011 at 4:16 am
Change the database 🙂
Most likely, when you logon as "same user"? you are connected to your database by default.
When you logon as SA, by default you are connected to master database.
So, try what is said in the first line :hehe:
August 23, 2011 at 4:29 am
Could also be a different schema. Try qualifying the object with the schema name.
-- Gianluca Sartori
August 23, 2011 at 6:19 am
Eugene Elutin (8/23/2011)
Change the database 🙂Most likely, when you logon as "same user"? you are connected to your database by default.
When you logon as SA, by default you are connected to master database.
So, try what is said in the first line :hehe:
Please see my orginal post
"If I then log on as SA and run the command against the same DB nothing is returned"
August 23, 2011 at 6:23 am
Gianluca Sartori (8/23/2011)
Could also be a different schema. Try qualifying the object with the schema name.
Yep thanks 🙂
August 23, 2011 at 6:28 am
you should be able to find what the issue is pretty easily;
if you change the object id below to the one you are looking for, what do you get?
on my server with 77 dev databases, i got 67 matches, some were PK,some tables , one was tempdb.sys.service_broker_map.
exec sp_msForEachDB '
select
''?'' as DbName,
schema_name(schema_id),
name,
object_id
from ?.sys.objects
where object_id = 2073058421 '
Lowell
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply