Re: Comments in SQL?



| For those who does think comments shouldn't be used, then please make a
big
| procedure with usage of functions with not that logical variables, put it
away
| and take a look in five years time and tell what you thought when you made
that.

agreed, however we are talking about database definition files here. it will
be pretty evident what the purpose of this is:

create table foo
(
id INT NULL AUTO_INCREMENT PRIMARY,
bar VARCHAR(25) NOT NULL
);

that leave commenting only for each field specifically and the possible
relationship(s) on field of one table to another field(s) in another table.
again, in this context, all that should be done in documentation.

as far as justifying comments in a database definition file because others
will look at, and edit, it...i put all of my table definitions in
alphabetical order - scroll till you find it or search for 'create table m'
to get you to where you need to be in the file. even if the file is not in
any order, the search will take care of finding tables starting with 'm'.
for new tables being defined (in a non-sorted file), just put it anywhere.

one should also think about upgrade paths for the db. the standard setup
should contain all the table definitions. there should be other, or a
single, file(s) that handles altering their definitions to support
developmental changes. at the same time that i recommend this, i seldom do
it anymore. i have a comparison tool that looks at the structure of a db
that has the 'correct', or most current, changes applied - like a staging
db. i then compare that structure to the target db. all the alterations are
handled in code to update the target system.

whether one places each table definition in its own file or in a single
file, i really couldn't care less as i don't think it matters. what does, is
making sure that the file(s) is clean and not cluttered with comments that
should be documented elsewhere. to me, the purpose of setup files is to
setup a db so a site can begin being used. documentation is to give you
queues. plus, there are plenty of good, free tools out there that not only
allow you to document a database, but also generate the definition file for
you on demand. that's the way to go.


.



Relevant Pages

  • Re: NFS shared directory permission (rhel6)
    ... Kerberos/LDAP/NFSv4 setup and write a small series on how to do this ... One of my biggest plaints is that much of the documentation out there ... wildly inaccurate or out of date tutorials (or tutorials specific to, ...
    (Fedora)
  • Site to site VPN IPSec Tunnel
    ... documentation to setup the following scenario. ... the Branch site, but setting up the ISA server is where I have run into ... SPI and Outbound SPI ... I will now be setting up any certificates in this setup. ...
    (microsoft.public.isa.vpn)
  • does isa2000 support site to site vpn
    ... documentation to setup the following scenario. ... the Branch site, but setting up the ISA server is where I have run into ... SPI and Outbound SPI ... I will now be setting up any certificates in this setup. ...
    (microsoft.public.isa.vpn)
  • Site to site VPN IPSec Tunnel
    ... documentation to setup the following scenario. ... the Branch site, but setting up the ISA server is where I have run into ... SPI and Outbound SPI ... I will now be setting up any certificates in this setup. ...
    (microsoft.public.isa.vpn)
  • Re: HP stopping VMS paper documentation ?
    ... Is there a separate line item for the documentation CDs? ... purchase (say you have a new customer) or whether it will be digital ... paper is also necessary when you do work at the SRM level or very low ... on the target system you are supporting, ...
    (comp.os.vms)