Home Forums SQL Server 7,2000 T-SQL store output of sp_helptext to local variable RE: store output of sp_helptext to local variable

  • It's not pretty, but you might try something like this:

    declare @t table(line varchar(8000))

    insert @t exec sp_helptext 'myProc'

    declare @ddl varchar(8000)

    select @ddl = ''

    select @ddl = @ddl + line

    from @t

    print @ddl