What does mean by two dotes.. ?

  • 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.

  • This msdb..backupset is equvilent to this msdb.dbo.backupset.

  • 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 ?

  • 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.

  • jitendra.padhiyar (4/26/2012)


    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 ?

    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


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply