?
Solved

migrate stored procedures

Posted on 2011-03-22
2
Medium Priority
?
291 Views
Last Modified: 2012-05-11
I have 625 stored procedure scripts which I need to migrate to a new testing database.

I have generated the scripts as files....however each script includes the "USE" statement with the name of the production database. For example:

Use [proddb1]

select * from dbo.tb1

I need to either:

Generate these scripts without the USE
Ignore the USE when the scripts are executed so that I can I load them into the new testing database.

Is this possible?
0
Comment
Question by:Mr_Shaw
2 Comments
 
LVL 8

Accepted Solution

by:
jawa29 earned 2000 total points
ID: 35196890
Hi Mr Shaw

Scripting this would be possible however as the USE [proddb1] is the same in each file why not try Notepad++ http://notepad-plus-plus.org/. This has a search and replace option that will allow you to specify a directory that holds the files.

Jawa29
0
 

Author Closing Comment

by:Mr_Shaw
ID: 35197132
Greate... worked like a trate
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Welcome, welcome!  If you are new to the series and haven't been following along, please take a brief moment to review the first three installments: Part 1 (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/A_266-VBScri…
Well hello again!  Glad to see you've made it this far without giving up.  In this, the fourth installment of my popular series, I'm going to cover functions and subroutines, what they are, and why they are useful.  Just in case you stumbled onto th…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Screencast - Getting to Know the Pipeline
Suggested Courses
Course of the Month15 days, 7 hours left to enroll

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question