Solved

migrate stored procedures

Posted on 2011-03-22
2
277 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 8

Accepted Solution

by:
jawa29 earned 500 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Recently I finished a vbscript that I thought I'd share.  It uses a text file with a list of server names to loop through and get various status reports, then writes them all into an Excel file.  Originally it was put together for our Altiris server…
Welcome back!  My apologies for taking so long to write part two of this series; it's been a long time coming!  As I promised in Part 1, this article will focus on how to locate those elusive AD properties that you are searching for.  Why is this us…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.
Suggested Courses

737 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