/*
select * from sysobjects
where xtype='fn'
sp_helptext [sp_helptext]
*/
declare @sql nvarchar(4000)
declare cur_GetSql cursor for
select a.text
from syscomments a inner join sysobjects b on a.id=b.id
where b.name='sp_help'
open cur_GetSql
fetch next from cur_GetSql into @sql
while (@@fetch_status = 0)
begin
print @Sql
fetch next from cur_GetSql into @sql
end
close cur_GetSql
deallocate cur_GetSql