第2个回答 2011-03-19
CREATE PROCEDURE [dbo].[backstore] AS
declare @strback varchar(2000)
declare @bakstr varchar(128)
set @bakstr=convert(varchar,getdate(),12)+convert(varchar(10),datename(hh,getdate()))+convert(varchar(10),datename(mm,getdate()))+convert(varchar(10),datename(ss,getdate()))
set @strback='BACKUP DATABASE [数据库名] TO DISK = N''E:\'+@bakstr+'数据库名'' WITH NOINIT , NOUNLOAD , NAME = N''数据库名 备份'', NOSKIP , STATS = 10, NOFORMAT'
--select @strback
exec (@strback)
GO
-------数据库导出的存储过程