Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Register Now and get your question answered!
Save Password
Forgot your Password?

 All Forums
 SQL Server 2012 Forums
 Transact-SQL (2012)
 Bulk replace input parameter in SP
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Posting Yak Master

219 Posts

Posted - 03/26/2014 :  17:09:52  Show Profile  Click to see mike13's MSN Messenger address  Reply with Quote
Hi All,

I made a mistake and made a ton of SP with the wrong parameter type

@site as nvarchar(60)

and should be

@site as varchar(50)

IS there a Query i can write to do this?
Are there any tools to do this kind of stuff?

Ahhh also got a list op SP i want to Add 'WITH RECOMPILE'

Thanks a lot

Edited by - mike13 on 03/26/2014 17:26:13

Posting Yak Master

219 Posts

Posted - 03/28/2014 :  09:20:38  Show Profile  Click to see mike13's MSN Messenger address  Reply with Quote
Found this that solved my problem:

b.Name AS [ObjectName],
CASE WHEN b.type ='p' THEN 'Stored Procedure'
WHEN b.type ='v' THEN 'View'
END AS [ObjectType]
,a.definition AS [Definition]
,Replace ((REPLACE(definition,'OLD Value','New Value')),'Create','ALTER') AS [ModifiedDefinition]
FROM sys.sql_modules a
( select type, name,object_id
from sys.objects
where type in (
'p' -- procedures
and is_ms_shipped = 0
ON a.object_id=b.object_id
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000