• Commenting a table

    From Jim@21:1/5 to All on Thu Jun 15 18:43:21 2017
    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?

    Thanks!
    Jim

    BTW the table is the expected values of the cumulative distribution of
    number of activities per day of the week, Saturday to Sunday, for some different scenarios, to determine which scenario is being followed --
    the scenario with the smallest difference from the observed data. This
    is an adaptation of the Kolmogorov-Smirnov test.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Erland Sommarskog@21:1/5 to Jim on Fri Jun 16 07:02:11 2017
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From rja.carnegie@gmail.com@21:1/5 to Erland Sommarskog on Fri Jun 16 00:53:16 2017
    On Friday, 16 June 2017 08:05:53 UTC+1, Erland Sommarskog wrote:
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Erland Sommarskog@21:1/5 to rja.carnegie@gmail.com on Fri Jun 16 10:36:30 2017
    (rja.carnegie@gmail.com) writes:
    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?

    That depends on how the table is scripted. Don't recall what the default
    is for extended properties. (I have never used them myself.)

    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.


    That's what they call an interesting idea. :-)


    --
    Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

    Books Online for SQL Server 2005 at http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx Books Online for SQL Server 2000 at http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)