Backup -- view the space required for backup and Restoration

Source: Internet
Author: User
-- ===================================================== ===============-- Used in SQL Server 2008 and SQL Server 2008 r2declare @ databbasebakpath nvarchar (500) set @ databbasebakpath = 'backup path' declare @ bakfilelist2008 table (logicalname nvarchar (128), physicalname nvarchar (260), type char (1), filegroupname nvarchar (128 ), size numeric (), maxsize numeric (), fileid bigint, createlsn numeric (), droplsn numeric () null, uniqueid uniqueidentifier, readonlylsn numeric () null, readwritelsn numeric (25, 0) null, comment bigint, sourceblocksize int, filegroupid int, loggroupguid uniqueidentifier null, comment numeric (25, 0) null, comment uniqueidentifier, isreadonly bit, ispresent bit, tdethumbprint varbinary (32) insert into @ bakfilelist2008 exec sp_executesql n 'Restore filelistonly from [email protected] ', n' @ databbasebakpath nvarchar (260)', @ databbasebakpath select * From @ response

 

-- ===================================================== ===============-- Used in SQL Server 2005 declare @ databbasebakpath nvarchar (500) set @ databbasebakpath = 'backup path' declare @ bakfilelist2005 table (logicalname nvarchar (128), physicalname nvarchar (260), type char (1), filegroupname nvarchar (128 ), size numeric (), maxsize numeric (), fileid bigint, createlsn numeric (), droplsn numeric () null, uniqueid uniqueidentifier, readonlylsn numeric () null, readwritelsn numeric () null, comment bigint, sourceblocksize int, filegroupid int, loggroupguid uniqueidentifier null, comment numeric () null, comment uniqueidentifier, isreadonly bit, ispresent bit) insert into @ bakfilelist2005 exec sp_executesql n 'Restore filelistonly from [email protected] ', n' @ databbasebakpath nvarchar (260)', @ databbasebakpath select * From @ bakfilelist2005

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.