Hi All,
i have a situation whereby the database backup is much larger than the actual database itself.
the database is only 20MB while the backup is 1.2GG.
The sql being run to create the backups is as follows:
DECLARE @dbName VARCHAR(33) -- database name
DECLARE @path VARCHAR(99) -- backup path
DECLARE @fileName VARCHAR(99) -- backup file name
DECLARE @fileQuarter CHAR(1) -- variable portion of file name
SET @path = 'D:\path'
-- Returns a Numeral from 1 to 4
-- Each Quarter you get a new backup file name
SELECT @fileQuarter = CONVERT (char(1),(MONTH(GETDATE())+2)/3, 112)
DECLARE db_cursor CURSOR FOR
SELECT name
FROM master.dbo.sysdatabases
-- Exclude all System Databases, if Needed -
WHERE name NOT IN ('db_names)
OPEN db_cursor
FETCH NEXT FROM db_cursor INTO @dbName
WHILE @@FETCH_STATUS = 0
BEGIN
SET @fileName = @path + @dbName + '_' + @fileQuarter + '.BAK'
-- Use INIT and SKIP to overwrite previous sets
BACKUP DATABASE @dbName TO DISK = @fileName WITH INIT, SKIP
FETCH NEXT FROM db_cursor INTO @dbName
END
CLOSE db_cursor
DEALLOCATE db_cursor
I though perhaps the backups were being appended but with the 'INIT' parameter that should not be the case.
The version of MSSQL is express, hence the windows batch file to backup the database.
anyone ever see this issue before?
Thanks,
niall
i have a situation whereby the database backup is much larger than the actual database itself.
the database is only 20MB while the backup is 1.2GG.
The sql being run to create the backups is as follows:
DECLARE @dbName VARCHAR(33) -- database name
DECLARE @path VARCHAR(99) -- backup path
DECLARE @fileName VARCHAR(99) -- backup file name
DECLARE @fileQuarter CHAR(1) -- variable portion of file name
SET @path = 'D:\path'
-- Returns a Numeral from 1 to 4
-- Each Quarter you get a new backup file name
SELECT @fileQuarter = CONVERT (char(1),(MONTH(GETDATE())+2)/3, 112)
DECLARE db_cursor CURSOR FOR
SELECT name
FROM master.dbo.sysdatabases
-- Exclude all System Databases, if Needed -
WHERE name NOT IN ('db_names)
OPEN db_cursor
FETCH NEXT FROM db_cursor INTO @dbName
WHILE @@FETCH_STATUS = 0
BEGIN
SET @fileName = @path + @dbName + '_' + @fileQuarter + '.BAK'
-- Use INIT and SKIP to overwrite previous sets
BACKUP DATABASE @dbName TO DISK = @fileName WITH INIT, SKIP
FETCH NEXT FROM db_cursor INTO @dbName
END
CLOSE db_cursor
DEALLOCATE db_cursor
I though perhaps the backups were being appended but with the 'INIT' parameter that should not be the case.
The version of MSSQL is express, hence the windows batch file to backup the database.
anyone ever see this issue before?
Thanks,
niall