I have a table that contains the criterion values for a statistical test
I use in a couple of places. In the code that uses the table I have a
comment that describes how the table was populated, and how its values
should be used. I would rather have that comment in the table itself, so
if someone calls up the table to modify it, or has SQL produce the
CREATE code, the comment will be there. Is it feasible to include a
comment in CREATE TABLE that will persist with the table?
Jim (jgeissman@socal.rr.com) writes:
I have a table that contains the criterion values for a statistical test
I use in a couple of places. In the code that uses the table I have a comment that describes how the table was populated, and how its values should be used. I would rather have that comment in the table itself, so
if someone calls up the table to modify it, or has SQL produce the
CREATE code, the comment will be there. Is it feasible to include a
comment in CREATE TABLE that will persist with the table?
The code for CREATE TABLE is not saved in the database, so that as such
would not work out. However, you can use extended properties to enter information about the table or various columns. You can enter them from Object Explorer in SSMS or use sp_addextendedproperty.
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Does that depend on the second developer taking
an interest in extended properties? Or does it
just pop up in the script of the table definition?
My goofy suggestion is to include a computed
column called "about_this_table", that is defined
to consist of the comment text as a literal char
string.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 112 |
Nodes: | 8 (1 / 7) |
Uptime: | 236:04:34 |
Calls: | 2,466 |
Calls today: | 1 |
Files: | 8,614 |
Messages: | 1,884,375 |