Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 getting SP from DB backup file

Author  Topic 

mike123
Master Smack Fu Yak Hacker

1462 Posts

Posted - 2007-11-13 : 05:11:25
Hi,

I dropped a SPROC, and was in the process of reacreating it when I lost power. Now I don't have the SPROC except for in an old backup file.

Is there anyway to get this without restoring the DB ? If not, can I easily restore to a different DB name and then delete it? My backups are on my live server and I don't want to overwrite my current DB with my backup :)


thanks for any suggestions!!

mike123

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-11-13 : 05:15:41
restore as a different name
copy the sp
drop the newly restored database



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

mike123
Master Smack Fu Yak Hacker

1462 Posts

Posted - 2007-11-13 : 08:20:48
Hi Peso,

Im getting this error.

"the backup set holds a backup of a database other than the existing 'tempDelete' database.


I created a new DB to restore into. I tried resontromg from file and filegroups, when I select the file I want to restore, I click options after and edit the destination LDF and MDF filenames. I am probably missing a step here???

thanks very much!!
mike123


Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2007-11-14 : 16:17:17
By default SQL Server will want to restore the the folder/database that the backup was originally made from.
Personally I find this much easier with the Command Syntax than the GUI.

For more details : http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=55210&SearchTerms=RESTORE%20syntax%20/%20example,Restore
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2007-11-14 : 16:20:57
quote:
Originally posted by mike123

I created a new DB to restore into.



That's the problem. If the database container exists, then you must select the overwrite option in the options tab/page. If you are doing this via T-SQL rather than the GUI, then you specify WITH REPLACE.

It is not necessary to create your database container to restore a database. In fact, it's a waste of time. Just specify the new database name in the restore GUI or command.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/
Go to Top of Page
   

- Advertisement -