Link to home
Start Free TrialLog in
Avatar of spamster
spamsterFlag for United States of America

asked on

Copy SQL Stored Procedures (Export and Import)

We have a DB that got corrupted and had to be repaired (log file was deleted) - unfortunately it seems like not everything was recovered.
It's a CRM database and when we try to run the redeployment wizard it fails. When we look at the logs to see why it failed we see :

04/22/2009 07:54:17 The object 'p_CascadeGrantAccess' does not exist in database 'AcmeWidgits_MSCRM'.
04/22/2009 07:54:17 Microsoft OLE DB Provider for SQL Server

We do have a backup, but it's at least a month old! If we recover that SQL DB, is it possible to export the stored procedure (or procedures...) then go back to the more current DB and IMPORT the stored procedures?
Avatar of mvgeertruyen
mvgeertruyen
Flag of Belgium image

It is - you can copy objects using the import/export wizard (amongst other ways of recreating them)
Avatar of spamster

ASKER

Ok, do both Databases have to be up at the same time to do that?
Or could I export to a file?
Or do I have to create a blank DB and export the stored procedures into that, and then restore the more current DB and import them in?
ASKER CERTIFIED SOLUTION
Avatar of mvgeertruyen
mvgeertruyen
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks man, I'm sure I can use this solution to get at least most of my data back :) Hope I can return the help that you gave some day.