|
|
|
Right there with Babe
      
Group: General Forum Members
Last Login: Tuesday, June 11, 2013 11:56 AM
Points: 772,
Visits: 1,828
|
|
I added this: select SO.name as 'table', SC.name as field, ST.name as datatype, SC.length as 'size', COALESCE (sp.value,df.Comment,'') as 'description'from syscolumns SC inner join sysobjects SO on SC.id = SO.id inner join systypes ST on ST.xusertype = SC.xusertype left join sysproperties sp on sp.id = so.id and sp.smallid = SC.colid and sp.name = 'MS_Description'left outer join doc_fields df on df.tablename = so.name and df.fieldname = SC.namewhere SO.xtype = 'U' and SO.status > 0order by SO.name, SC.colorderNow it looks into the extended properties or my table.
ATB
Charles Kincaid
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Tuesday, June 11, 2013 1:47 PM
Points: 111,
Visits: 479
|
|
I keep a corresponding dictionary database for every database I design with descriptions of the tables, views and columns. Good idea to add stored procs, I hadn't thought of that. I'm required to document data classification (you know what's sensitive and what's not), so that's in there too. For that last database I developed, all the columns are populated from a non-windows system so I added the source information too. Now I can talk to the admins on that system in their terms if I need to.
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Sunday, October 18, 2009 8:21 AM
Points: 24,
Visits: 68
|
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Friday, November 16, 2007 8:42 AM
Points: 2,
Visits: 2
|
|
dbdesc (mentioned earlier in this thread) can generate Word 2003 and RTF documents among others. It uses XSL templates so the output can be fully customized.
Additionally, it includes a built-in extended property editor to easily manage descriptions. In my opinion, extended properties are the perfect place to store your comments as they go together with your database.
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Today @ 7:28 AM
Points: 2,766,
Visits: 1,441
|
|
Don't forget Innovasys DocumentX. It covers SQL Server, Oracle, Access and also does .NET assemblies, Visual Studio projects, ActiveX and VBA.
After using a proper tool I wouldn't use a word processor for documentation because
- It is not easy to update
- It is not intrinsically linked to the database so can be obsolete fast
- Does not automatically cross reference to bookmarks within itself
- Isn't a natural reference format (such as CHM or web ) for programmer
- Is very bulky
It sounds obvious but the purpose of documentation is to be read. There is a great skill in writing a complex document in such a way that it is easy to pick up the salient facts quickly.
LinkedIn Profile
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Friday, May 16, 2008 12:45 AM
Points: 3,
Visits: 10
|
|
| This idea seems to be good.
|
|
|
|
|
SSC-Addicted
      
Group: General Forum Members
Last Login: Wednesday, January 11, 2012 9:54 AM
Points: 470,
Visits: 588
|
|
also sqlspec does more than just SQL Server.
Oracle, MySQL, Access, Analysis Services are supported.
DB2, Sybase, PostgreSQL coming soon...
--------------------------------------- elsasoft.org
|
|
|
|
|
Mr or Mrs. 500
      
Group: General Forum Members
Last Login: Monday, May 21, 2012 3:13 PM
Points: 516,
Visits: 1,563
|
|
For those of you who want to use the extended properties and think that there is no extended properties for the table in general, there is a way to enter it directly from Enterprise Manager. When you are in Design Table, right click one of the columns and chose Properties. The field called Description on the Tables tab is stored in the extended properties. You can access it from a script with: SELECT @tabledesc = value FROM ::fn_listextendedproperty(NULL, N'user', N'dbo', N'table', @tblname, DEFAULT, DEFAULT)
I have a script called usp_Table_Doc that takes the table name as a parameter outputs a file layout, complete with the extended properties as descriptions, if anyone is interested. Steve
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Today @ 7:28 AM
Points: 2,766,
Visits: 1,441
|
|
You can also right-click on the object in the object tree within SQL Query Analyser
LinkedIn Profile
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Monday, June 10, 2013 12:08 PM
Points: 35,
Visits: 176
|
|
Andy DBA (1/11/2007)
CORRECTION. The prior posted sql may have duplicates. The following should work better:
--List tables, columns and column descriptions select SO.name as 'table', SC.name as field, ST.name as datatype, SC.length as 'size', sp.value as 'description' from syscolumns SC inner join sysobjects SO on SC.id = SO.id inner join systypes ST on ST.xusertype = SC.xusertype left join sysproperties sp on sp.id = so.id and sp.smallid = SC.colid and sp.name = 'MS_Description' where SO.xtype = 'U' and SO.status > 0 order by SO.name, SC.name
When I try to run the query I get an error "Msg 208, Level 16, State 1, Line 2 Invalid object name 'sysproperties'."
If i remove the sysproroerties table from the query the query will run, for some reason its the only table that I can't find.
Furthermore I logged in as SA to see if it was a permissions error, but I still got the same error.
Next question (could be linked to the problem above), if i wanted to browse these tables, how would I access them?
My first guess, using the SQL SMS would be to go
DB -> Tables -> System Tables -> sysproperties
Thanks in advance Kris
However the only table in "System Tables" is sysdiagrams
|
|
|
|