Problem:
When backing up an SQL Server database, you can specify a file name. Suppose we need to back up data every day, and we want to back up different file names every day, for example, using the current date as the file name
My answer:
Use master
Go
Backup database [sampledatabase] to disk = n'd: \ backup \ '+Convert (nvarchar (10), getdate (), 112)+ '. Bak' with noformat, noinit, name = n' sampledatabase-full database backup', Skip, norewind, nounload, stats = 10
Go
By the author: Chen xizhang in 2009/7/15 10:21:45 published in: http://www.cnblogs.com/chenxizhang/
This article is copyrighted by the author and can be reproduced. However, this statement must be retained without the consent of the author. ArticleThe original text connection is clearly displayed on the page. Otherwise, the legal liability is retained.
For more blog articles, as well as the author's complete comments on Blog references and the policy of cooperation, please refer to the following site: Chen xizhang's blog Center