How to take database backup ? My path is considering date format 103 slash(/) as folder which I dont

Posted by Shantanu Gupta on Stack Overflow See other posts from Stack Overflow or by Shantanu Gupta
Published on 2010-04-21T06:41:43Z Indexed on 2010/04/21 6:43 UTC
Read the original article Hit count: 159

I am trying to take database backup. How can I do that when getdate is being appended with file name with format dd/mm/yyyy.

declare @dbName VARCHAR(100)
declare @path VARCHAR(100)
set @dbName='CallMeIndia'
set @path='F:\'+@dbName +'-'+convert(varchar(50),getdate(),103)+'.bak'
BACKUP DATABASE @dbName
TO DISK= @path 

© Stack Overflow or respective owner

Related posts about database

Related posts about database-backups