Author |
Topic |
edgarsk
Starting Member
8 Posts |
Posted - 2010-04-22 : 09:46:01
|
Hello,I need help to resolve this problem,Source: Windows SQL server 2000 SP4I made full DB backup of my DB (TEST_DB)Destination:windows SQL server 2005 SP2I restore DB (TEST_DB)But now i cannot make query like:select * from table1I only can select like this:select * from user.table1In SQL 2000 all works fine.Any have ideas what is problem? |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-04-22 : 09:48:43
|
that means your default schema is not user. change the default schema to user if you want to continue refering tables without prefixing schema nameALTER USER <your username here> WITH DEFAULT_SCHEMA = user; ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
edgarsk
Starting Member
8 Posts |
Posted - 2010-04-22 : 12:08:07
|
quote:
ALTER USER <your username here> WITH DEFAULT_SCHEMA = user;
I done this, but doesnot work.. |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-04-23 : 02:37:07
|
why? whats the issue? what does below give you?SELECT SCHEMA_NAME();------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
edgarsk
Starting Member
8 Posts |
Posted - 2010-04-23 : 04:37:45
|
quote: Originally posted by visakh16 why? whats the issue? what does below give you?SELECT SCHEMA_NAME();------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/
I dont know why i can't select....give new query tab |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-04-23 : 06:13:45
|
what? what does it return?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
edgarsk
Starting Member
8 Posts |
Posted - 2010-04-23 : 11:49:13
|
quote: Originally posted by visakh16 what? what does it return?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/
Nothing |
|
|
edgarsk
Starting Member
8 Posts |
Posted - 2010-04-26 : 05:16:18
|
When i create Synonym, like:synonym name: TABLE1 (previous user.TABLE1)synonym schema <b>dbo</b>server name...Schema <b>epas</b>Object name <b>TABLE1</b>after this i can make queryy from table TABLE1 without user prefix user.TABLE1 |
|
|
edgarsk
Starting Member
8 Posts |
Posted - 2010-04-26 : 10:03:59
|
quote: Originally posted by visakh16 what? what does it return?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/
now he return schema dbo |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-04-27 : 00:48:35
|
quote: Originally posted by edgarsk
quote: Originally posted by visakh16 what? what does it return?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/
now he return schema dbo
you mean after you set synonym?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
edgarsk
Starting Member
8 Posts |
Posted - 2010-04-27 : 01:27:52
|
quote: Originally posted by visakh16
quote: Originally posted by edgarsk
quote: Originally posted by visakh16 what? what does it return?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/
now he return schema dbo
you mean after you set synonym?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/
when do:SELECT SCHEMA_NAME(); |
|
|
edgarsk
Starting Member
8 Posts |
Posted - 2010-04-27 : 09:24:43
|
Maybe any ideas what can i do anymore, to resolve my problem about it? |
|
|
|