Generate SQL Scripts using T-SQL

  • Hi All,

    I need your SQL guru's help:

    I want to generate SQL scripts for all the objects, like tables, defaults, index, triggers, procedures, and all the stuff from SQL Server 7.

    I can use EM to do that. But my question is how to achieve the same thing using T-SQL script.

    Thanks,

    Chris

  • No exactly sure, but you can try the sp_help system stored procedures, but I have only used sp_helptext on sprocs before, which will show the text of the sproc (which you can save and run on another db to re-create the sproc).

    If you know VB or some such language, you can use the SQL-DMO object model to script objects.


    When in doubt - test, test, test!

    Wayne

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply