|
Posted by athos on 01/08/06 09:45
Hi guys, please help.
What I did is :
Step1. create a Database named [Test], it's default owner is [sa]
Step2. create a User in Database [Test] named [kimliuTest], which maps
to the Login [kkhad\kimliu] on this Database Server, it's a windows
domain user.
Step3. create a Schema in Database [Test] named [schTest], whose Schema
Owner is User [kimliuTest]
Step4. created two tables: [dbo].[t1] and [schTest].[t2]
Step5. run the script
ALTER USER kimliuTest WITH DEFAULT_SCHEMA = schTest
to set the default schema.
Now my problem is, when I try to run
select * from schTest.t2
, everything is OK, but if I run
select * from t2
the error message says:
Msg 208, Level 16, State 1, Line 1
Invalid object name 't2'.
why? I'm loggin in with my [kkhad\kimliu] windows domain id , Active
Monitor also shows that. but the command does not work?
Yeah, it's a good habit to write the full name of the Table with Schema
name as prefix, however, we did our development in SQL 2000 and trying
to upgrade to SQL2005, so trying to avoid scanning codes and inserting
in thousand of places.
How could we omit the Schema name when referrring to Tables? Thanks.
ps. I posted in another topic days ago, but nobody is replying, when I
tried to bring it forward by replying myself, it failed. please help me
, thanks!
Navigation:
[Reply to this message]
|