Click here to Skip to main content
14,331,130 members
Rate this:
Please Sign up or sign in to vote.
hi every body sup??!
i have database with sql 2008
i wanna create a strode procedure or everything you think is better for
backup from my database
and save that in other drives
how can i do this??
Posted
Rate this:
Please Sign up or sign in to vote.

Solution 2

Hi,

Include the below 2 scripts in your stored procedure and it will do the trick..it will take a backup and will restore it too.

BACKUP DATABASE [ReportServer] TO  DISK = N'H:\Backup\ReportServer.bak' WITH NOFORMAT, NOINIT,  NAME = N'ReportServer-Full Database Backup', SKIP, NOREWIND, NOUNLOAD,  STATS = 10
GO


RESTORE DATABASE [ReportServer] FROM  DISK = N'H:\Backup\ReportServer.bak' WITH  FILE = 1,  NOUNLOAD,  REPLACE,  STATS = 10
GO


Happy Coding..

regards
anurag
   
v2
Comments
rpm3d 13-Feb-13 4:08am
   
thank you
Anurag Sinha V 13-Feb-13 4:12am
   
np..happy coding.. :)

-anurag
Rate this:
Please Sign up or sign in to vote.

Solution 1

1. First write all your procedures in your database.
2. Take a backup.
3. Restore the backup in your database server.

Pictorial description you can find from the below link:

http://kb.eukhost.com/backup-and-restore-ms-sql-server-2008-database/[^]

- Arindam
   
Comments
rpm3d 13-Feb-13 4:07am
   
thank you

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




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100