You can combine all the column values in the sql pass variable in many ways.
as examples: XMLPATH , STUFF or COALESCE , with some string manipulation.
Go
Go T-SQL
, sql Go, : -
Msg 102, Level 15, State 1, Line 4 "go".
stackoverflow, : -
sql
( ): -
Demo: -
Create database Demo
go
use Demo
go
Create table MyTable (procName varchar (200))
go
insert into MyTable values ('proc_1')
go
insert into MyTable values ('proc_2')
go
insert into MyTable values ('proc_3')
go
insert into MyTable values ('proc_4')
go
declare @Query nvarchar(max)
SELECT @Query = isnull(@Query,'') + 'create proc ['+[ProcName]+'] as
print '''+[ProcName]+''''+ char (10) + '
Go
'
FROM MyTable
SET @Query = 'EXEC (''' + REPLACE(REPLACE(@Query, '''', ''''''), 'GO', '''); EXEC(''') + ''');'
EXEC (@Query)
: -

