Double Dot table qualifier

Thanks to this dot, the default schema (dbo) is choosen for your query.

When you have two databases it is required to give the full path to the table.
If we have:
Database1 schema: dbo, guest table dbo.A, guest: A
Database2 schema: dbo, guest table dbo.B, guest: B

if we create select statement like:

select * from Database2..B

We are selecting data from dbo.B table
IF we would like to specify schema we need to refer as

select * from Database2.schemaname.tablename

EDIT:
As colleagues pointed out, the default schema can be changed in database, however in this particular example it seems to be dbo 🙂

Leave a Comment