Sunday, February 12, 2012

Backup information

Hi,
I need to get information from a backup file. For example the logical name
of database file (data/log) that exist in the backup set.
I know that RESTORE FILELISTONLY and RESTORE HEADERONLY provide this
information, but I need to get them in variables, or something that makes me
able to use these information in my dynamic tsql string.
Thanks in advance,
LeilaKimberly Tripp has a real cool script that automatically backups
a 2000 database and restores to 2005. It uses a temporary table
#BackupFileList to hold the filelist info.
--
INSERT #BackupFileList
EXEC('LOAD FILELISTONLY FROM DISK = ''c:\temp\$(DB).bak''')
--
then she works through the temporary table using a cursor.
3-10b2d34981bb" target="_blank">http://www.sqlskills.com/blogs/kimb...
3-10b2d34981bb
--
Karl Tarbet
MCSD .net|||And some potentially useful code here as well:
http://www.karaszi.com/SQLServer/ut...all_in_file.asp
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Karl" <ktarbet@.[xx-no-spam-xx]gmail.com> wrote in message
news:CAD48B53-94CC-413F-B1CF-B9DC9547E470@.microsoft.com...
> Kimberly Tripp has a real cool script that automatically backups
> a 2000 database and restores to 2005. It uses a temporary table
> #BackupFileList to hold the filelist info.
> --
> INSERT #BackupFileList
> EXEC('LOAD FILELISTONLY FROM DISK = ''c:\temp\$(DB).bak''')
> --
> then she works through the temporary table using a cursor.
> f33-10b2d34981bb" target="_blank">http://www.sqlskills.com/blogs/kimb...33-10b2d34981bb
> --
> Karl Tarbet
> MCSD .net
>

No comments:

Post a Comment