Hi, I am just unsure what use of ".." means. I cannot google it due to characters itself. I think it can be written also that way?: INSERT INTO X.dbo.Y. Or what is it? Thank you
+3
A:
it tells you to use the default schema in sql servers
these 2 are the same
select * from master..sysobjects
select * from master.dbo.sysobjects
SQLMenace
2010-02-09 12:53:43
Thank you..I do not know much about schemas. What it looks like if you wanted to use different one?
Snake
2010-02-09 13:08:48
As I've just posted - if you want it to use a different schema then dbo, just make that the default schema for the user who's issuing the command
Damien_The_Unbeliever
2010-02-09 13:29:34
you would change dbo to the other schema name. So if the schema name is HR it would be select * from master.HR.sysobjects
SQLMenace
2010-02-09 14:00:43
A:
Roughly translated your insert statement translates to
- Insert - I am sure you got that bit
- INTO - Part of the insert statement
- X - The Database you want to insert into
- dbo - The Schema owner
- Y - The Table
Rihan Meij
2010-02-09 12:55:25
+1
A:
It takes the default schema for the current logged in user, not necessarily dbo, as others have posted.
So if there are two tables in the target database, e.g. dbo.Users and Client.Users, and you issue a "select * from DB..Users", then the results will vary based on whether the person who issues the query has dbo or Client as their default schema.
And for more info, look under the Multipart names section of BOL
Damien_The_Unbeliever
2010-02-09 13:28:34