SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Best practice for implementing restore of DB
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Shivan86
Starting Member

India
4 Posts

Posted - 03/28/2013 :  05:50:49  Show Profile  Reply with Quote
I have working stored procs for backup and restore of DB. i have a question.If i copy these stored procs in respective database folders, how do i execute restore DB? Whats the best practise for keeping stored proc for restore and backup of DB.

I am using SQL 2005 express edition.

thanks.

visakh16
Very Important crosS Applying yaK Herder

India
52309 Posts

Posted - 03/28/2013 :  05:57:22  Show Profile  Reply with Quote
you dont need to copy stored proc files to any folder. once you create proc it will reside within database. then everytime you need to execute it just call the stored procedure as

EXEC procedurename parameter1=value1,parameter2=value2,...

depending on number of parameters it require

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

Shivan86
Starting Member

India
4 Posts

Posted - 03/28/2013 :  06:06:02  Show Profile  Reply with Quote
Thanks for the reply!
got it but lets say i have one DB by the name 'production'. If i am running a stored procedure from production to restore the same database will it work ?
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52309 Posts

Posted - 03/28/2013 :  06:24:13  Show Profile  Reply with Quote
nope..you've to run procedure from master.

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

jackv
Flowing Fount of Yak Knowledge

United Kingdom
2011 Posts

Posted - 03/31/2013 :  02:57:22  Show Profile  Visit jackv's Homepage  Reply with Quote
or any other database , except the one the one you're trying to restore

Jack Vamvas
--------------------
http://www.sqlserver-dba.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000