mj_cole
asked on
Ability to export the sql behind a SP / view / query to an ascii file ?
Is there a way that I can export the SQL behind a stored procedure or view, into a text file, or preferably into a recordset string field.
My absolute ideal would to have a stored procedure that returns a recordset with the database object name and the SQL in the object, be it a stored procedure or a view, that I can use to get ascii copies of all my db objects, such that I can see their progress over time in CVS.
Any ideas ?
Regards
Marts
My absolute ideal would to have a stored procedure that returns a recordset with the database object name and the SQL in the object, be it a stored procedure or a view, that I can use to get ascii copies of all my db objects, such that I can see their progress over time in CVS.
Any ideas ?
Regards
Marts
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
sp_helptext seems to do the job :)
is there a master SP to return all the stored procedures and views, such that I can then write my own SP to get the list and then call sp_helptext on that list ?
Regards
Marts
is there a master SP to return all the stored procedures and views, such that I can then write my own SP to get the list and then call sp_helptext on that list ?
Regards
Marts
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Actually I think the information_schema views only return the first 4K of object text, so it's not a safe way to get the source. You really need to use sp_helptext.
Brett