01 |
set ANSI_NULLS ON |
02 |
set QUOTED_IDENTIFIER ON |
03 |
go |
04 |
|
05 |
|
06 |
ALTER PROCEDURE [dbo].[dbBak] |
07 |
|
08 |
AS |
09 |
BEGIN |
10 |
DECLARE @sqlCommand NVARCHAR(1000) |
11 |
DECLARE @dateTime NVARCHAR(20) |
12 |
SELECT @dateTime = REPLACE ( CONVERT ( VARCHAR , GETDATE(),111), '/' , '' ) + |
13 |
REPLACE ( CONVERT ( VARCHAR , GETDATE(),108), ':' , '' ) |
14 |
SET @sqlCommand = 'BACKUP DATABASE BLNBusyData TO DISK = ' 'D:\DataBaseBakUp\bln_' + @dateTime + '.BAK' '' |
15 |
EXECUTE sp_executesql @sqlCommand |
16 |
END |