Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ASP / Database Access / June 2007



Tip: Looking for answers? Try searching our database.

Commenting in Sql

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
shiv.shankar.dr@gmail.com - 18 Jun 2007 12:57 GMT
I am using Adodb in Vb6 and Access 2000
i want to know how i can have some text commented with in Sql
statement,
Bob Barrows [MVP] - 18 Jun 2007 14:21 GMT
> 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

Signature

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.

Brian Tkatch - 18 Jun 2007 16:40 GMT
>> 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.
Bob Barrows [MVP] - 18 Jun 2007 17:00 GMT
>>> I am using Adodb in Vb6 and Access 2000
>>> i want to know how i can have some text commented with in Sql
[quoted text clipped - 5 lines]
>
> 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.

Signature

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.

Brian Tkatch - 25 Jun 2007 15:29 GMT
>>>> I am using Adodb in Vb6 and Access 2000
>>>> i want to know how i can have some text commented with in Sql
[quoted text clipped - 8 lines]
>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.
Bob Barrows [MVP] - 25 Jun 2007 15:44 GMT
>>>>> I am using Adodb in Vb6 and Access 2000
>>>>> i want to know how i can have some text commented with in Sql
[quoted text clipped - 12 lines]
> 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

Signature

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.

Jon Paal [MSMD] - 21 Jun 2007 17:53 GMT
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,
Bob Barrows [MVP] - 21 Jun 2007 18:51 GMT
Why not? it would be nice to have.

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

> 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,

Signature

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.

Jon Paal [MSMD] - 22 Jun 2007 17:56 GMT
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.

> Why not? it would be nice to have.
>
[quoted text clipped - 5 lines]
>>> i want to know how i can have some text commented with in Sql
>>> statement,
Bob Barrows [MVP] - 22 Jun 2007 18:16 GMT
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.

> generally folks comment in their stored procedures, or in their code.
>
[quoted text clipped - 16 lines]
>> header is my spam trap, so I don't check it very often. You will get
>> a quicker response by posting to the newsgroup.

Signature

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"

Jon Paal [MSMD] - 22 Jun 2007 18:48 GMT
seems the OP has been the only one not participating here...
Bob Barrows [MVP] - 22 Jun 2007 18:56 GMT
> seems the OP has been the only one not participating here...
:-)
True
Signature

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"

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.