MS Access SQL formatting?

daveWP

Registered User.
Local time
Today, 04:27
Joined
Sep 18, 2009
Messages
28
So I'm trying to write nice code and formatting all the bells and whistles in the SQL view of query design.

Does anyone know how to make access save my code formatting and stop concatenating all my SQL strings together and converting all my NOT EXISTS keywords to EXISTS=False?

I guess if it does this as a performance optimization, then I'll leave it alone. Does anyone know?

I'm using Access 2003
 
damn,
I tried to put a bunch of spaces and exaggerated formatting to get it to stick. It works with some, but not with others.

Thanks any way
 
I could be wrong and wouldn't consider it a reliable solution... but if you always write SQL in the SQL view and never ever open it in design view (even by accident, which is hard part), then it won't be re-formatted.

Beyond that, I agree with George- we'll have to live with it. It's been a feature oft-requested for very long time.

As for optimizations, I know there are few times where Access try to format the SQL into an invalid string and barf an error on us. Thankfully, they are quite rare (my memory says it only happens when you have an UNION query but I'm not 100% sure on that). Beyond that, JET does re-write the query to use most effective construct. You can observe this happening if you turn on SHOWPLAN and read the output.
 
Thanks.

(this reply is too short, so here is some padding)
 

Users who are viewing this thread

Back
Top Bottom