Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

SQL Profanities

By Ken Simmons,

Cursors, Views, Functions, Dynamic SQL, Global Temp Tables, Undocumented Procedures; these are just a few of the phrases that have been deemed "SQL Profanities" to certain individuals. I am sure some of you are cringing after hearing all those words at once, but I strongly believe there is a use for all of these "profanities" as long as they are used correctly.

I think some capabilities in SQL Server have such a negative connotation that they are avoided at all costs. It is true that all of these features can lead to inefficient code, but a select statement in the wrong hands can lead to inefficient code as well. Does this mean we should avoid querying data all together to improve efficiency because someone may write a bad query?

I am in no way promoting the use of bad code, I just don't agree with blanket statements claiming you should never use a certain feature that is available in SQL Server. I think you should always strive to write the best code you can, but on the other hand I am not afraid to use the tools that I have been given. I also know that there are several ways to do the same thing; some better than others. Even the best SQL Coders may not always think of the most efficient way to write a query. If someone comes along and provides a better solution, I chalk it up as a learning experience and gladly accept the advice.

Instead of just vowing to never use certain functionality, try to come up with your best solution and have it evaluated using a code review. If you use something that can be easily abused such as a cursor, it should be reviewed and accepted by the group. I know not all of us have the luxury of working with a group of DBA's where you can have formal code reviews, but you can always reach out to the Online Community for help. There are more than enough people willing to help you find the best solution. Sometimes the best solution may be the one that you have been trying to avoid all along.

At the end of the day you have to get the job done. The end user does not care what happens in the background as long as they have an acceptable working solution. It is our job as DBA's and Developers to provide the best possible solution in the time frame we have been given; even if it means being a little "profane" every now and then.

Ken Simmons


The Voice of the DBA Podcasts

Everyday Jones

The podcast feeds are now available at sqlservercentral.podshow.com to get better bandwidth and maybe a little more exposure :). Comments are definitely appreciated and wanted, and you can get feeds from there.

Overall RSS Feed: or now on iTunes!

Today's podcast features music by Everyday Jones. No relation, but I stumbled on to them and really like the music. Support this great duo at www.everydayjones.com.

I really appreciate and value feedback on the podcasts. Let us know what you like, don't like, or even send in ideas for the show. If you'd like to comment, post something here. The boss will be sure to read it.

Total article views: 354 | Views in the last 30 days: 1
 
Related Articles
BLOG

Podcast Upgrades

A minor change for the podcasts next week. I got my wireless microphone, and I'm working with it a b...

BLOG

Podcasting

I'm working on getting a small studio set up for some podcasting of the editorials. That means I put...

ARTICLE

Podcast Announcements

Podcast Feeds

BLOG

Technical Podcasts I Listen To

There are a few podcasts I tend to listen to as I have time. Since I work with a wide...

ARTICLE

Accept Failure

Today Steve Jones talks about the risk inherent in any project, and how we should be aware of our mi...

Tags
editorial    
 
Contribute

Join the most active online SQL Server Community

SQL knowledge, delivered daily, free:

Email address:  

You make SSC a better place

As a member of SQLServerCentral, you get free access to loads of fresh content: thousands of articles and SQL scripts, a library of free eBooks, a weekly database news roundup, a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals that makes it such a success.

Join us!

Steve Jones
Editor, SQLServerCentral.com

Already a member? Jump in:

Email address:   Password:   Remember me: Forgotten your password?
Steve Jones