SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Documenting of SQL 2005 DB


Documenting of SQL 2005 DB

Author
Message
a_ud
a_ud
Mr or Mrs. 500
Mr or Mrs. 500 (503 reputation)Mr or Mrs. 500 (503 reputation)Mr or Mrs. 500 (503 reputation)Mr or Mrs. 500 (503 reputation)Mr or Mrs. 500 (503 reputation)Mr or Mrs. 500 (503 reputation)Mr or Mrs. 500 (503 reputation)Mr or Mrs. 500 (503 reputation)

Group: General Forum Members
Points: 503 Visits: 368
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
homebrew01
homebrew01
SSChampion
SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)

Group: General Forum Members
Points: 12158 Visits: 9222
"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...



bitbucket-25253
bitbucket-25253
SSCoach
SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)

Group: General Forum Members
Points: 15523 Visits: 25280
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

Before posting a performance problem please read
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search