Click here to Skip to main content
15,898,938 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to back the database and save it in D Drive....I need to write that code in one button...while clicking it total database to backup
Posted

use this query
BACKUP DATABASE dbName TO DISK = 'PATH'
RESTORE DATABASE dbName FROM DISK = 'PATH'
 
Share this answer
 
v2
Comments
itsureshuk 18-Feb-12 1:13am    
i worked out this query... i got error

BACKUP DATABASE Project_Modules TO DISK = 'D:\testing.bak'




Msg 3201, Level 16, State 1, Line 1
Cannot open backup device 'D:\testing.bak'. Operating system error 1005(The volume does not contain a recognized file system. Please make sure that all required file system drivers are loaded and that the volume is not corrupted.).
Msg 3013, Level 16, State 1, Line 1
BACKUP DATABASE is terminating abnormally.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900