Wonderwall
asked on
SQL server 2005 Data dictionary
Aloha, I want to create a data dictionary and be able to print it out. I know I can put the descriptions in the extended properties or description in the databse diagram but how can I access these properties using sql? mahalo
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Not sure exactly how you want to approach this, but first I would suggest 'database diagrams'. Go into SSMS, Databases, select your database and then see 'Database Diagrams' within the hierarchy. Right click it, and choose to create a new diagram. You will be given the option to select one or multiple tables, and then choose 'Add'.
It will push the chosen tables to the diagram, with keys referenced in each table. You could then right click the diagram and choose to 'Show Relationship Labels', add text annotations (like table descriptions, business reference), and even copy it to the clip board for use within a graphics editor of your choosing.
Then, of course, you've always got 'sp_help'. This is the system proc, you run it by object, like this:
EXEC sp_help 'tablename'
If you didn't want to run it selectively, per table, you could always cursor through the tables, pumping results to temp table, and then loop through the temp table to retrieve the data, per table.
The code I've posted below is also handy. It generates the table definition (create statement) for the give @tablename.
Open in new window