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.
| Author |
Topic |
|
kesz1
Starting Member
2 Posts |
Posted - 2008-06-18 : 00:00:50
|
| HiI just restored a bak file to our SQL server Express and I need some help. For some reason, the only time a SQL statement will work is if I add the database name to the front of the table:select * from dbname.tablenameBelow will not work:select * from tablenameAny thoughts? |
|
|
raky
Aged Yak Warrior
767 Posts |
Posted - 2008-06-18 : 00:36:49
|
| select * from daname.dbo.tablename |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-06-18 : 00:48:11
|
quote: Originally posted by kesz1 HiI just restored a bak file to our SQL server Express and I need some help. For some reason, the only time a SQL statement will work is if I add the database name to the front of the table:select * from dbname.tablenameBelow will not work:select * from tablenameAny thoughts?
probably you're running it against the wrong database. try like thisuse [yourdbname]select * from tablename |
 |
|
|
kesz1
Starting Member
2 Posts |
Posted - 2008-06-18 : 06:41:42
|
| This did the trick:sp_changeobjectowner 'userName.TableName','dbo'Now I can run it without referencing the db name in the query.Thanks for your help. |
 |
|
|
|
|
|