Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 How to Access Other User's Table

Author  Topic 

bridge
Yak Posting Veteran

93 Posts

Posted - 2005-04-05 : 09:19:47
I have a table in database created by user TIM now I want to run SELECT query on this table but I got the error Invalid Object Name. Please tell me how can I run SELECT on this table?

derrickleggett
Pointy Haired Yak DBA

4184 Posts

Posted - 2005-04-05 : 09:23:12
SELECT col1, col2 FROM TIM.table

MeanOldDBA
derrickleggett@hotmail.com

When life gives you a lemon, fire the DBA.
Go to Top of Page

bridge
Yak Posting Veteran

93 Posts

Posted - 2005-04-05 : 09:25:45
But I do not want to use the user name as I have lot of stored procedures referencing the table.
Go to Top of Page

derrickleggett
Pointy Haired Yak DBA

4184 Posts

Posted - 2005-04-05 : 09:29:13
Well, then change the owner to dbo. You probably shouldn't have TIM owning the table anyway.

EXEC sp_changeobjectowner 'TIM.table','dbo'

Be sure you test this on development first of course.

MeanOldDBA
derrickleggett@hotmail.com

When life gives you a lemon, fire the DBA.
Go to Top of Page

bridge
Yak Posting Veteran

93 Posts

Posted - 2005-04-05 : 09:32:51
Actually we have a software which logs in through NT login and when we create the Table it creates it taking NT login as the user. And this NT user does not have the right to execute sp_changeobjectowner. When other NT user runs a report on that table it gets error Invalid Object Name.
Go to Top of Page
   

- Advertisement -