1 |
"C:\Program Files\Microsoft SQL Server90\Tools\Binn\sqlcmd" -S localhost -i e:\Backupbackup.sql |
풀백업
1 2 3 4 5 6 7 8 9 |
declare @runtime nvarchar(10) declare @backupdevice nvarchar(100) declare @backupname nvarchar(100) set @runtime = substring(convert(nvarchar(20), getdate(), 8) ,1,2) set @backupdevice = N'e:\Backupbackup_' + @runtime + N'.bak' set @backupname = N'backup_' + @runtime BACKUP DATABASE [TU] TO DISK = @backupdevice WITH NOFORMAT, INIT, NAME = @backupname, SKIP, NOREWIND, NOUNLOAD, STATS = 10 |
증분 백업
1 2 3 4 5 6 7 8 9 |
declare @runtime nvarchar(10) declare @backupdevice nvarchar(100) declare @backupname nvarchar(100) set @runtime = substring(convert(nvarchar(20), getdate(), 8) ,1,2) set @backupdevice = N'e:\Backupbackup_' + @runtime + N'.bak' set @backupname = N'backup_' + @runtime BACKUP DATABASE [TU] TO DISK = @backupdevice WITH DIFFERENTIAL, NOFORMAT, INIT, NAME = @backupname, SKIP, NOREWIND, NOUNLOAD, STATS = 10 |
Leave a Reply