Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Create procedure [dbo].[temp] @DbSrcName nvarchar(max), @DbDisName nvarchar(max), @DbPath nvarchar(max) ASDeclare @Str varchar(500)EXEC( 'BACKUP DATABASE '+ @DbSrcName +' TO DISK = '+ @DbPath + '.bak'' WITH NOFORMAT, INIT, NAME = '+ @DbDisName +', SKIP, NOREWIND, NOUNLOAD, STATS = 10, CHECKSUM ')
please help me!
visakh16
Very Important crosS Applying yaK Herder
52326 Posts
Posted - 2010-11-28 : 07:52:47
Doesnt seem like any problem. what was error you got?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts
Posted - 2010-11-28 : 08:20:07
Apart from that NOREWIND and NOUNLOAD are for tapes and unnecessary when doing disk backups... Might be a stray ' after the file name. Looks like you forgot to add an escaped quote before the file name.Hint: When doing dynamic SQL, print the result instead of executing it. Then you can easily see what the problems are and it's far faster than asking a bunch of random people to do your basic debugging for you.--Gail ShawSQL Server MVP