Home Forums SQL Server 2005 Administering Stored Procedure with varchar(max) as parameter RE: Stored Procedure with varchar(max) as parameter
Aashini Shah
Ten Centuries
Points: 1129
More actions
May 25, 2010 at 8:58 am
#1172137
Assuming that you are passing the script to be executed in @SQLStat parameter, your procedure should be:
create proc ExecuteScripts (@SQLstat varchar(max))
as
begin
exec ( @SQLstat )
end
Also check sp_executesql if you need to use dynamic sql.
Neepa