﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2005 / SQL Server 2005 General Discussion  / Change schema in stored procedure / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Tue, 21 May 2013 01:49:59 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Change schema in stored procedure</title><link>http://www.sqlservercentral.com/Forums/Topic1039605-149-1.aspx</link><description>declare @name sysnameselect top 1 @name=SPECIFIC_NAME from INFORMATION_SCHEMA.ROUTINES where ROUTINE_TYPE='PROCEDURE' AND ROUTINE_SCHEMA='ABC'while (@name is not null)beginexecute( 'ALTER SCHEMA XYZ TRANSFER ABC.' + @name);select top 1 @name=SPECIFIC_NAME from INFORMATION_SCHEMA.ROUTINES where ROUTINE_TYPE='PROCEDURE' AND ROUTINE_SCHEMA='ABC'End</description><pubDate>Tue, 28 Dec 2010 08:13:23 GMT</pubDate><dc:creator>nekonecny</dc:creator></item><item><title>RE: Change schema in stored procedure</title><link>http://www.sqlservercentral.com/Forums/Topic1039605-149-1.aspx</link><description>Export the stored procedures out to a script or set of alter scripts. Make the changes in the scripts. Run the scripts against the server. For a mechanism to automate this you might look at Red Gate's tool, [url=http://www.red-gate.com/products/sql-development/sql-prompt/]SQL Prompt[/url], which has a bunch of automatic refactoring mechanisms, just like this.</description><pubDate>Tue, 28 Dec 2010 08:04:54 GMT</pubDate><dc:creator>Grant Fritchey</dc:creator></item><item><title>Change schema in stored procedure</title><link>http://www.sqlservercentral.com/Forums/Topic1039605-149-1.aspx</link><description>Hello I have a bunch of stored procedure(more than 200) in my database.I have to change the schema of those now. They have the schema ABC. I have to change it to XYZ,.I know [ALTER SCHEMA XYZ TRANSFER ABC.STOREDPROCEDURE] query would do.But the no of stored procedure is huge . I cannot do one by one. Is there any other way to do this task.thanks</description><pubDate>Mon, 27 Dec 2010 17:24:32 GMT</pubDate><dc:creator>manoharanpraveen</dc:creator></item></channel></rss>