• rightontarget (12/4/2013)


    but then I will have to edit every procedure to make sure that joins point to test instance of the database.

    so your procedures are using three part naming conventions to explicitly identify the database? is that the problem? ie SELECT * from Production.dbo.Table 1 Inner Join Production.dbo.table2?

    or you also have cross database queries, that join, say the Production database and CommonSecurity database?

    i could see how that would be an issue; i'd end up putting something together that did a find-replace-alter on all the stored procs in that case, and make it something reusable.

    I have a sample fo that somewhere, using a cursor, if you thought that might help, but it assumes certain conventions, like the definitiosn are "CREATE PROCEDURE" with a single space between them, which you might need to change depending on your style of coding procs/functions

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!