• jcaradocdavies (5/6/2010)


    Just a small concern...

    As far as experience and memory serves, sp_helptext is not a reliable source for recreating SQL server objects. SQL management objects are the preferred source.

    Changes to an object and/or metadata may render sp_helptext outdated - the script used to create the original object may not reflect the object in its current state. I seem to remember a case where the sp_helptext record was blatantly incorrect after a (?) designer edit.

    Does anyone have a concise view of when this may occur, and whether stored procedures are for practical purposes immune to these cases?

    The only problem I've found is that on rare occasions it does odd things with line breaks.

    These become obviously evident when you try to run the script as the script will fail.