日期:2014-05-18 浏览次数:20410 次
USE [test] GO /****** 对象: StoredProcedure [dbo].[BackupFullDB] 脚本日期: 05/09/2012 04:34:21 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER PROCEDURE [dbo].[BackupFullDB] @DBName VARCHAR(100), @ym VARCHAR(6), @ymd VARCHAR(8), @BackupFile VARCHAR(100), @BackName VARCHAR(100), @tmp VARCHAR(100), @backupSetId INT AS EXECUTE ('BACKUP DATABASE' + ' ' + '[' + @DBName + ']' + 'TO DISK =' + @BackupFile + ' ' + 'WITH' + ' ' + 'NOFORMAT' + ',NOINIT' + ',NAME =' + @BackName + ',SKIP' + ',NOREWIND' + ',NOUNLOAD' + ',STATS =' + @backupSetId + ',CHECKSUM')
USE test DECLARE @DBName VARCHAR(100) DECLARE @ym VARCHAR(100) DECLARE @tmp VARCHAR(100) DECLARE @BackupFile VARCHAR(100) DECLARE @BackName VARCHAR(100) DECLARE @backupSetId INT EXECUTE dbo.BackupFullDB @DBName = 'Beijixiong_Data', @ym = Convert(char(6),getdate() ,112), @tmp = '''验证失败。找不到数据库' + @DBName + '的备份信息。''', @BackupFile = N'''E:\FULL\' + @DBName + '_' + 'full' + '_' + @ym + '.bak''', @BackName = '''' + @DBName + '_' + 'full' + '_' + @ym + '''', @backupSetId = 10