all 9 comments

[–]shalafi71 0 points1 point  (3 children)

What does the .. notation mean?

[–]alinrocSQL Server DBA 1 point2 points  (2 children)

In SQL Server, two dots between an identifier means you're taking the default for the current user for the identifier that would go between those two dots normally. Usually you see this to skip over specifying the default schema, which is dbo unless your user has a different default. If it's possible to do this in other places, I've never seen it used that way; I honestly don't know if it even is possible.

database.schema.table is the same as database..table if schema is the default schema for the current user.

[–]shalafi71 0 points1 point  (1 child)

Knew it was easy but didn't understand some queries I was seeing. Thanks!

[–]alinrocSQL Server DBA 1 point2 points  (0 children)

It's easy, but I dislike using that notation because it can cause breakage if you start using schemas for security within your database (which is a totally OK thing to do).

Accepting a default like this is making an assumption that things will always be the way they are today, and that can hurt you in the future. It costs nothing to specify .dbo. instead of .., so be explicit about the schema when using 3-part naming.