-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date,,>
-- Description: 目前要备份的数据库名,备份文件路径均写在过程中,不需外部传入
-- =============================================
CREATE PROCEDURE UP_BackUPDataBase
@databasename nvarchar(50)=null,
@strPath NVARCHAR(200)=null
AS
BEGIN SET NOCOUNT ON;
if(@databasename is null)
begin
set @databasename = 'IS60DB'
end
if(@strPath is null)
begin
set @strPath = convert(NVARCHAR(19),getdate(),120)
set @strPath = REPLACE(@strPath, ':' , '.')
set @strPath = 'E:\DBBAck\' + @databasename+@strPath + '.bak'
end
BACKUP DATABASE @databasename TO DISK = @strPath WITH NOINIT , NOUNLOAD , NOSKIP , STATS = 10, NOFORMAT
END
GO