Starting from scratch, best practices, no apparent way to ingest comments
I'm new to your products and I noticed SQL Doc and thought it would be nice to use, but it seems like it is focused on documenting existing databases and doesn't seem to help when documenting from the start. I have created the initial scripts for our new database schema (32 tables, 177 columns), typed documentation into the script, and I started looking for a way for me to format the table and column comments in that script file for ingestion into SQL Doc, but I don't see anything like that. Also, the sample generated output shows the ugly, redundant, SQL Server-generated DDL for the tables (where I would want my well-formatted DDL).
It's not really an option to run my script in and then use the SQL Doc UI to copy and paste each of the couple hundred comments from that same script. I was looking at some programs that I found on the net that parse the build script and extract all the comments to push them into the extended_properties tables (with varying success), so I figured SQL Doc would have something like that, but I haven't found it yet. I would also want it to store my clearly formatted DDL.
Am I missing something or just looking at the wrong tool?
Best Answer
-
Jon_Kirkwood Posts: 423 Silver 5
Hi @sgartner
Thank you for reaching out on the Redgate forums regarding your SQL Doc query.
You are correct that SQL Doc is used for manual documentation of existing databases and there isn't much automation to bulk update these records.
They are pulled from MS_Description and updated via extended_properties.
I found this blog post which may be of relevance where it goes through methods of scripting database descriptions. Might be able to modify your existing scripts or create a new process to help incorporate this.
Outside of this I don't believe there other tools that would assist. Our Compare tool is able to copy comments/descriptions between databases but it wouldn't generate new comments.
Jon Kirkwood | Technical Support Engineer | Redgate Software
Answers
Thanks for the response and the link. I am disappointed and the article you linked has some interesting concepts, but storing scripts that are better generated automatically is a mistake. Here is the technique that I'm working on. Start with the a schema build script with comments inline: