Commenting in Sql
am 18.06.2007 13:57:01 von shiv.shankar.drI am using Adodb in Vb6 and Access 2000
i want to know how i can have some text commented with in Sql
statement,
I am using Adodb in Vb6 and Access 2000
i want to know how i can have some text commented with in Sql
statement,
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.
On Mon, 18 Jun 2007 09:21:43 -0400, "Bob Barrows [MVP]"
>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.
Brian Tkatch wrote:
> On Mon, 18 Jun 2007 09:21:43 -0400, "Bob Barrows [MVP]"
>
>
>> 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.
why ?
>I am using Adodb in Vb6 and Access 2000
> i want to know how i can have some text commented with in Sql
> statement,
>
Why not? it would be nice to have.
To the OP, most people use the Description property for comments.
Jon Paal [MSMD] wrote:
> why ?
>
>
>
>
> 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.
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]"
> Why not? it would be nice to have.
>
> To the OP, most people use the Description property for comments.
>
> Jon Paal [MSMD] wrote:
>> why ?
>>
>>
>>
>>
>> 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.
>
>
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]"
> 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 ?
>>>
>>>
>>>
>>>
>>> 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"
seems the OP has been the only one not participating here...
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"
On Mon, 18 Jun 2007 12:00:54 -0400, "Bob Barrows [MVP]"
>Brian Tkatch wrote:
>> On Mon, 18 Jun 2007 09:21:43 -0400, "Bob Barrows [MVP]"
>>
>>
>>> 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.
Brian Tkatch wrote:
> On Mon, 18 Jun 2007 12:00:54 -0400, "Bob Barrows [MVP]"
>
>
>> Brian Tkatch wrote:
>>> On Mon, 18 Jun 2007 09:21:43 -0400, "Bob Barrows [MVP]"
>>>
>>>
>>>> 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.