Commenting in Sql

Commenting in Sql

am 18.06.2007 13:57:01 von shiv.shankar.dr

I am using Adodb in Vb6 and Access 2000
i want to know how i can have some text commented with in Sql
statement,

Re: Commenting in Sql

am 18.06.2007 15:21:43 von reb01501

shiv.shankar.dr@gmail.com wrote:
> I am using Adodb in Vb6 and Access 2000
> i want to know how i can have some text commented with in Sql
> statement,

It can't. Jet (Access) does not support comments in sql statements

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Re: Commenting in Sql

am 18.06.2007 17:40:47 von Patrick Kremer

On Mon, 18 Jun 2007 09:21:43 -0400, "Bob Barrows [MVP]"
wrote:

>shiv.shankar.dr@gmail.com wrote:
>> I am using Adodb in Vb6 and Access 2000
>> i want to know how i can have some text commented with in Sql
>> statement,
>
>It can't. Jet (Access) does not support comments in sql statements

Unless, perhaps, he "cheats" and uses it in the WHERE caluse:

WHERE 'Comment' <> 'This is a comment on how this thing works.'

B.

Re: Commenting in Sql

am 18.06.2007 18:00:54 von reb01501

Brian Tkatch wrote:
> On Mon, 18 Jun 2007 09:21:43 -0400, "Bob Barrows [MVP]"
> wrote:
>
>> shiv.shankar.dr@gmail.com wrote:
>>> I am using Adodb in Vb6 and Access 2000
>>> i want to know how i can have some text commented with in Sql
>>> statement,
>>
>> It can't. Jet (Access) does not support comments in sql statements
>
> Unless, perhaps, he "cheats" and uses it in the WHERE caluse:
>
> WHERE 'Comment' <> 'This is a comment on how this thing works.'
>
Clever, but there will be an impact on performance since this expression
will need to be evaluated against every row in the table.

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Re: Commenting in Sql

am 21.06.2007 18:53:09 von Jon Paal

why ?



wrote in message news:1182167821.189313.51130@g37g2000prf.googlegroups.com...
>I am using Adodb in Vb6 and Access 2000
> i want to know how i can have some text commented with in Sql
> statement,
>

Re: Commenting in Sql

am 21.06.2007 19:51:41 von reb01501

Why not? it would be nice to have.

To the OP, most people use the Description property for comments.

Jon Paal [MSMD] wrote:
> why ?
>
>
>
> wrote in message
> news:1182167821.189313.51130@g37g2000prf.googlegroups.com...
>> I am using Adodb in Vb6 and Access 2000
>> i want to know how i can have some text commented with in Sql
>> statement,

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Re: Commenting in Sql

am 22.06.2007 18:56:27 von Jon Paal

generally folks comment in their stored procedures, or in their code.

I've never heard of a comment inside an sql statement. not sure I would vote for that.



"Bob Barrows [MVP]" wrote in message news:%23obVUzCtHHA.4800@TK2MSFTNGP05.phx.gbl...
> Why not? it would be nice to have.
>
> To the OP, most people use the Description property for comments.
>
> Jon Paal [MSMD] wrote:
>> why ?
>>
>>
>>
>> wrote in message
>> news:1182167821.189313.51130@g37g2000prf.googlegroups.com...
>>> I am using Adodb in Vb6 and Access 2000
>>> i want to know how i can have some text commented with in Sql
>>> statement,
>
> --
> Microsoft MVP -- ASP/ASP.NET
> Please reply to the newsgroup. The email account listed in my From
> header is my spam trap, so I don't check it very often. You will get a
> quicker response by posting to the newsgroup.
>
>

Re: Commenting in Sql

am 22.06.2007 19:16:19 von reb01501

A saved parameter query is Jet's equivalent of a stored procedure. I will
not debate whether it fits your definition of "stored procedure". One
executes it from ADO the same way one executes a SQL strored procedure. One
adds/modifies it in ADOX using the Procedures collection, the same way a SQL
stored procedure is maintained using ADOX

I am assuming the OP is talking about a saved query, and not an ad hoc sql
statement being built in his script. In the latter case, the comments of
course should go in the script. In the former, the Description property
works well.

I have an old Access aplication with hundreds of saved queries in it. It
would be impossible to maintain that application today if I had not utilized
the Description property to store comments about the saved queries.

Jon Paal [MSMD] wrote:
> generally folks comment in their stored procedures, or in their code.
>
> I've never heard of a comment inside an sql statement. not sure I
> would vote for that.
>
>
> "Bob Barrows [MVP]" wrote in message
> news:%23obVUzCtHHA.4800@TK2MSFTNGP05.phx.gbl...
>> Why not? it would be nice to have.
>>
>> To the OP, most people use the Description property for comments.
>>
>> Jon Paal [MSMD] wrote:
>>> why ?
>>>
>>>
>>>
>>> wrote in message
>>> news:1182167821.189313.51130@g37g2000prf.googlegroups.com...
>>>> I am using Adodb in Vb6 and Access 2000
>>>> i want to know how i can have some text commented with in Sql
>>>> statement,
>>
>> --
>> Microsoft MVP -- ASP/ASP.NET
>> Please reply to the newsgroup. The email account listed in my From
>> header is my spam trap, so I don't check it very often. You will get
>> a quicker response by posting to the newsgroup.

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

Re: Commenting in Sql

am 22.06.2007 19:48:35 von Jon Paal

seems the OP has been the only one not participating here...

Re: Commenting in Sql

am 22.06.2007 19:56:35 von reb01501

Jon Paal [MSMD] wrote:
> seems the OP has been the only one not participating here...
:-)
True
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

Re: Commenting in Sql

am 25.06.2007 16:29:08 von Patrick Kremer

On Mon, 18 Jun 2007 12:00:54 -0400, "Bob Barrows [MVP]"
wrote:

>Brian Tkatch wrote:
>> On Mon, 18 Jun 2007 09:21:43 -0400, "Bob Barrows [MVP]"
>> wrote:
>>
>>> shiv.shankar.dr@gmail.com wrote:
>>>> I am using Adodb in Vb6 and Access 2000
>>>> i want to know how i can have some text commented with in Sql
>>>> statement,
>>>
>>> It can't. Jet (Access) does not support comments in sql statements
>>
>> Unless, perhaps, he "cheats" and uses it in the WHERE caluse:
>>
>> WHERE 'Comment' <> 'This is a comment on how this thing works.'
>>
>Clever, but there will be an impact on performance since this expression
>will need to be evaluated against every row in the table.

Really? In a literal against a literal, it need to be executed only
once, and the result stored. I would think any optimizer would remove
the clause entirely as it would always be true.

B.

Re: Commenting in Sql

am 25.06.2007 16:44:53 von reb01501

Brian Tkatch wrote:
> On Mon, 18 Jun 2007 12:00:54 -0400, "Bob Barrows [MVP]"
> wrote:
>
>> Brian Tkatch wrote:
>>> On Mon, 18 Jun 2007 09:21:43 -0400, "Bob Barrows [MVP]"
>>> wrote:
>>>
>>>> shiv.shankar.dr@gmail.com wrote:
>>>>> I am using Adodb in Vb6 and Access 2000
>>>>> i want to know how i can have some text commented with in Sql
>>>>> statement,
>>>>
>>>> It can't. Jet (Access) does not support comments in sql statements
>>>
>>> Unless, perhaps, he "cheats" and uses it in the WHERE caluse:
>>>
>>> WHERE 'Comment' <> 'This is a comment on how this thing works.'
>>>
>> Clever, but there will be an impact on performance since this
>> expression will need to be evaluated against every row in the table.
>
> Really? In a literal against a literal, it need to be executed only
> once, and the result stored. I would think any optimizer would remove
> the clause entirely as it would always be true.
>
So one would think/hope. I'm pretty sure you are correct where SQL
Server is concerned (although I've never tested it). I am not so sure
with Jet. The only way to be sure is to look at a query plan and see if
a table scan is forced where an index would be more optimal. Getting a
Jet query plan is a pain, as I recall. Maybe someone in the Access
newsgroups knows for sure so I am crossposting this to
m.p.access.queries

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.