ouch! or... why best practices are not just for sprocs :)

Often, I've found that I use some of the more well-known best practices, such as aliasing tables used in a query, fully qualifying the field scope even if you “think” there is no ambiguity, etc., when writing queries that I intend to SAVE (views, sprocs, whatever), but not when I'm running ad-hoc “on-demand” type things.

This post shows at least one example of why it's a good idea to use these practices even when doing your “ad-hoc” queries.

I feel your pain Scott!

Print | posted on Thursday, July 01, 2004 8:04 AM

Feedback

# re: ouch! or... why best practices are not just for sprocs :)

left by Mike Swaim at 7/5/2004 9:43 AM Gravatar
One of the nice things about Oracle is that everything's inside a transaction. I believe that DBArtisan also lets you do ad hoc SQL inside a transaction. That capability's saved my bacon more than once.

# re: ouch! or... why best practices are not just for sprocs :)

left by Tara at 7/6/2004 12:12 PM Gravatar
"One of the nice things about Oracle is that everything's inside a transaction. I believe that DBArtisan also lets you do ad hoc SQL inside a transaction. That capability's saved my bacon more than once. "

You can do this in Query Analyzer as well. Just set the option in Tools..Options..Connection Properties (set implicit_transactions). Or set the option in the query window once you connect: SET IMPLICIT_TRANSACTIONS OFF.
Comments have been closed on this topic.