Why can't i backup database using t-sql?

杀马特。学长 韩版系。学妹 提交于 2019-12-13 00:50:56

问题


I try to backup database using code below :

backup database RestaurantManagement to disk = 'd:\'

sqlserver always show the message below :

Msg 3201, Level 16, State 1, Line 3 Cannot open backup device 'd:\'. Operating system error 3(The system cannot find the path specified.). Msg 3013, Level 16, State 1, Line 3 BACKUP DATABASE is terminating abnormally.

How can i code it ? help...


回答1:


You need to provide the backup file name, like this:

backup database RestaurantManagement to disk = 'd:\backups\RestaurantManagement.bak'



回答2:


Are you a member of the appropriate sql role? Does the account which Sql Server is running under have permissions to the path? Are you sure the media is available on the server? What I mean is, you may have a d: on your machine, but the paths you give are for the remote server.

The error you're getting indicates there's no d: drive, or no folder named backups.

I would double check all those things.



来源:https://stackoverflow.com/questions/6557490/why-cant-i-backup-database-using-t-sql

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!