Generating Scripts for Database Objects

  • Hi,

    I was wondering if anyone can help me figure out a way to script out all the database objects to separate files. For example a sql file for each:

    Stored Procedure

    Function

    Trigger

    View

    etc

    The problem is that Generating the scripts from EM wont let me create a separate file for each trigger they all end up table defintion files.

    Any ideas?

    MCITP SQL 2005, MCSA SQL 2012

  • The trigger can't exist without the table, so I think it's a dependent object that goes in there. You ought to be able to get the others as separate files.

    The triggers just need to be manually separated out.

  • After playing about with all the options in EM I have managed to do this.

    It created them all with the file extension .TRG I then used a freeware application to change all the extensions to .sql.

    Just need to keep trying to see if I can get it to do the same with Primary and Foreign keys etc.

    Thanks anyway.

    R

    MCITP SQL 2005, MCSA SQL 2012

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

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