Where does SQLServer stores ResultSet

  • Hi everyone.

    Can someone please help me in this.

    Where does SQLServer stores result-set if we issue the following command in the Query Analyzer.

    RESTORE HEADERONLY FROM DISK=''

    Thanx.

    Muneeb.

  • I beleiev it is in the MSDB database in the backupset tables

    backupset

    backupmediaset

    backupmediafamily

    backupfile

    Not sure if all but at least one of those.

  • The rsultset is not stored. If you want the result in a table, you should do like this :

    create table #header

    (

    BackupName nvarchar(128),  -- Backup set name.

    BackupDescription  nvarchar(255), -- Backup set description.

    BackupType smallint,    -- Backup type:

         -- 1 = Database

         -- 2 = Transaction Log

         -- 4 = File

         -- 5 = Differential

         -- Database

         -- 6 = Differential File

    ExpirationDate datetime,  -- Expiration date for the backup set.

    Compressed tinyint,   -- SQL Server does not support software compression.

    Position smallint,   -- Position of the backup set in the volume (for use with the FILE = option).

    DeviceType tinyint,   -- Number corresponding to the device used for the backup operation.

    UserName nvarchar(128),   -- Username that performed the backup operation.

    ServerName nvarchar(128),  -- Name of the server that wrote the backup set.

    DatabaseName nvarchar(128),  -- Name of the database that was backed up.

    DatabaseVersion  int,   -- Version of the database from which the backup was created.

    DatabaseCreationDate  datetime,  -- Date and time the database was created.

    BackupSize numeric(20,0),  -- Size of the backup, in bytes.

    FirstLSN numeric(25,0),   -- Log sequence number of the first transaction in the backup set. NULL for file backups.

    LastLSN numeric(25,0),   -- Log sequence number of the last transaction in the backup set. NULL for file backups.

    CheckpointLSN  numeric(25,0),  -- Log sequence number of the most recent checkpoint at the time the backup was created.

    DatabaseBackupLSN  numeric(25,0), -- Log sequence number of the most recent full database backup.

    BackupStartDate  datetime,  -- Date and time that the backup operation began.

    BackupFinishDate  datetime,  -- Date and time that the backup operation finished.

    SortOrder smallint,   -- Server sort order. This column is valid for database backups only. Provided for backward compatibility.

    CodePage smallint,   -- Server code page or character set used by the server.

    UnicodeLocaleId int,   -- Server Unicode locale ID configuration option used for Unicode character data sorting.

    UnicodeComparisonStyle int,  -- Server Unicode comparison style configuration option.

    CompatibilityLevel  tinyint,  -- Compatibility level setting of the database from which the backup was created.

    SoftwareVendorId  int,   -- Software vendor identification number.

    SoftwareVersionMajor  int,  -- Major version number of the server that created the backup set.

    SoftwareVersionMinor  int,  -- Minor version number of the server that created the backup set.

    SoftwareVersionBuild  int,  -- Build number of the server that created the backup set.

    MachineName nvarchar(128),  -- Name of the computer that performed the backup operation.

    Flags int,    -- Bit 0 (X1) indicates bulk-logged data is captured in this log backup.

    BindingID uniqueidentifier,  -- Binding ID for the database.

    RecoveryForkID uniqueidentifier, -- ID for the current recovery fork for this backup.

    Collation nvarchar(128)   -- Collation used by the database.

    )

    insert #header

    exec ('

    RESTORE HEADERONLY

    FROM DISK = ''F:\ftproot\HPSQLTRIX\wwwdtrix\20040318.bac''')

  • Thanx Bert De Haes. This is what I was actually looking for. One more question please. It's kind of silly but since I'm new and would like to find out what does # means before the table name in your reply.

    Thanx man for your help.

    Muneeb.

  • Create a local temp table available only to the user on the current connection. See temp tables in BOL.

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

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