Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

Documenting of SQL 2005 DB Expand / Collapse
Posted Friday, January 14, 2011 3:39 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Thursday, December 17, 2015 2:41 AM
Points: 81, Visits: 331

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
Post #1047805
Posted Monday, January 17, 2011 9:46 AM



Group: General Forum Members
Last Login: Friday, November 18, 2016 12:42 PM
Points: 2,947, Visits: 9,054
"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...

Post #1048835
Posted Monday, January 17, 2011 10:39 AM



Group: General Forum Members
Last Login: Sunday, January 4, 2015 7:55 AM
Points: 5,333, Visits: 25,280
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.


Please help us, help you -before posting a question please read

Before posting a performance problem please read
Post #1048855
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse