Documenting of SQL 2005 DB

  • Hi,

    I'm trying to extract the code of standard procedures, table-valued functions and the like in a 2005 SQL DB. Apart from copying-pasting the code into a TXT file, is there a simpler and quicker way to do that, for instance to check that at home?

    I'd be happy with a method either: 1) For the whole database 2) For a type or set of procedures.

    Thanks in advance

  • "right click" Database -> Tasks -> Generate Scripts

    Assuming you're on a current service pack, you can choose to export into 1 big file, or into individual files per object.

    You also get a screen where you can choose to include indexes, contraints etc...

  • For Objects of type P, RF, V, TR, FN, IF, TF, and R try this:

    SELECT * FROM sys.sql_modules

    Which gives you all you want to know. You will most likely want to examine the columns available in sql_modules and limit the amount of information returned.

    And save the output to a file for later examination. I have found it useful to save it finally as a word doc and then I can use the search features of word to find in a table/column or whatever is returned in more than one SP ...

    Good luck.

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

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

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