April 26, 2012 at 2:26 pm
I was reading about backup compression where i seen "msdb..backupset".
What does that "..: (two dotes) indicate ?
many time seen that when Database.tablename that means table is relational to that database when declare with single dot.
From above example of msdb..backupset i seen that there is a table dbo.backupset in system tables under msdb.
Can anyone please explain the use of that two dotes?
Thanks in advance.
April 26, 2012 at 2:29 pm
This msdb..backupset is equvilent to this msdb.dbo.backupset.
April 26, 2012 at 2:38 pm
Okay, so even
use msdb
SELECT backup_size/compressed_backup_size FROM backupset
Or
use msdb
SELECT backup_size/compressed_backup_size FROM dbo.backupset
are same as
use msdb
SELECT backup_size/compressed_backup_size FROM msdb..backupset
Am I correct ?
April 26, 2012 at 2:42 pm
Yes, for the most part.
The .. is shorthand for avoiding the dbo schema in the name. It might work with default schemas in other databases, but I'd have to check.
The recommendation is to qualify things with the schema to avoid any issues.
April 29, 2012 at 5:04 pm
jitendra.padhiyar (4/26/2012)
Okay, so evenuse msdb
SELECT backup_size/compressed_backup_size FROM backupset
Or
use msdb
SELECT backup_size/compressed_backup_size FROM dbo.backupset
are same as
use msdb
SELECT backup_size/compressed_backup_size FROM msdb..backupset
Am I correct ?
Yes... unless you log is as "Homer" and there's an object named msdb.homer.backupset. Then you'll be in for a surprise on the first and 3 runs above. 🙂
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply