Task:
Create 100 or so stored procedure scripts similar to the convention of
Generating Script from EM automatically. I thought of essentially two
things of a) using sp_helptext to get the content of a sp; and b) using
bcp to write such content to a (dynamic) file. What bugs me is really
the curse of dynamic sql.
process inside a cursor:
------------------------
exec master..xp_cmds hell 'bcp "exec sp_helptext '+@spName+'" queryout
'+@spName+'.txt -c -SmyServerName -Usa -PmyPwd'
Error = [Microsoft][ODBC SQL Server Driver]Function sequence error
TIA
Create 100 or so stored procedure scripts similar to the convention of
Generating Script from EM automatically. I thought of essentially two
things of a) using sp_helptext to get the content of a sp; and b) using
bcp to write such content to a (dynamic) file. What bugs me is really
the curse of dynamic sql.
process inside a cursor:
------------------------
exec master..xp_cmds hell 'bcp "exec sp_helptext '+@spName+'" queryout
'+@spName+'.txt -c -SmyServerName -Usa -PmyPwd'
Error = [Microsoft][ODBC SQL Server Driver]Function sequence error
TIA
Comment