Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12345»»»

Just curious, what are your SQL pet peeves ? Expand / Collapse
Author
Message
Posted Thursday, May 29, 2014 1:23 PM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Today @ 10:59 AM
Points: 21,619, Visits: 15,275
Sean Lange (5/29/2014)
samalex (5/29/2014)
Wow, I agree with literally 100% of what you guys have entered, including 'sprocs'. We have a few non-DBA's who use this verbiage, and it always makes me cringe.


I don't know why but I always think of Vulcans when I hear "sproc".


I think of Spacely Space Sprockets




Jason AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server


SQL RNNR

Posting Performance Based Questions - Gail Shaw
Posting Data Etiquette - Jeff Moden
Hidden RBAR - Jeff Moden
VLFs and the Tran Log - Kimberly Tripp
Post #1575813
Posted Thursday, May 29, 2014 1:32 PM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Today @ 12:26 PM
Points: 1,535, Visits: 4,249
Sean Lange (5/29/2014)
samalex (5/29/2014)
Wow, I agree with literally 100% of what you guys have entered, including 'sprocs'. We have a few non-DBA's who use this verbiage, and it always makes me cringe.


I don't know why but I always think of Vulcans when I hear "sproc".

That, and I ignore the pun, would be my pointy ears
Post #1575818
Posted Thursday, May 29, 2014 1:54 PM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Today @ 12:26 PM
Points: 1,535, Visits: 4,249
samalex (5/29/2014)
Everyone has their own style of writing code and doing things, but there are some pet peeves I've developed over the years, especially when I review other people's code, and I'm curious to know what pet peeves you guys have too.

Here are some of mine:

Just a quick thought:
- Commas at the beginning of the line instead of end. Not sure why this bugs me, but it does.

Columnar editing with variable length lines! Makes it easier, and of course ignoring JC's rant about punch cards.

- Sub-Selects when a CTE or Join will work
Working from bottom up, CTEs may not be the most readable options
- SSIS packages with a single Script Task and nothing else. My thought, just write it in VS, save it to an EXE, and schedule it as a Windows Task instead of adding the overhead of SSIS and SQL


Gives an immense power, packets creating packets, fully metadata driven, do it all the time.

- Spaces in column names. I generally try to use square brackets around my column names anyway, but I also always avoid using spaces in column names though not everyone else does


+100!


- Trying to use object oriented programming techniques within SQL. This comes from queries a few of my former colleagues (all Dot Net developers) used to write where they'd embed small queries into Views and Functions with their queries becoming a hierarchy of sorts. When troubleshooting I'd often have to dig 8-10 views or functions deep or more before finding where the table was actually used. A house of cards indeed.

+1, cannot object to that!

Anyway, not to sound like a stickler, but just a few things that always catch my eye :) I assume most DBA's have a similar list of things that make them cringe, so just curious to see what's on anyone else's list.

Not being a DBA, no comment
Post #1575831
Posted Thursday, May 29, 2014 2:08 PM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Today @ 12:14 PM
Points: 3,478, Visits: 7,521
I'm not in favor of "sprocs" but I prefer them over "store procedures". AFAIK, we're not selling anything.
At work we have DTS that simply call an SP or even better, they have a SQL task with "SELECT 1".
But one of the worst things is having to read code written as if formatting was prohibited and the less lines the better.
Other things are:
SQL-86 Joins and JOIN keywords on the right of the tables.



Luis C.
Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

Forum Etiquette: How to post data/code on a forum to get the best help
Post #1575840
Posted Thursday, May 29, 2014 2:15 PM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 12:04 PM
Points: 13,239, Visits: 12,081
Luis Cazares (5/29/2014)
JOIN keywords on the right of the tables.


+1000 That one drives me nuts!!! (ok I know it is a short trip)


_______________________________________________________________

Need help? Help us help you.

Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

Need to split a string? Try Jeff Moden's splitter.

Cross Tabs and Pivots, Part 1 – Converting Rows to Columns
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs
Understanding and Using APPLY (Part 1)
Understanding and Using APPLY (Part 2)
Post #1575844
Posted Thursday, May 29, 2014 2:38 PM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Today @ 10:59 AM
Points: 21,619, Visits: 15,275
Sean Lange (5/29/2014)
Luis Cazares (5/29/2014)
JOIN keywords on the right of the tables.


+1000 That one drives me nuts!!! (ok I know it is a short trip)


NOT a fan of that format style either. At least ctrl ky fixes that.

Same with trailing commas. I dislike that practice but it is an easy one to fix with a little ctrl ky.

In case you are wondering, I dislike trailing commas because it makes it more of a pain to comment out a column if I want to test the results without the column. It also helps break up the list kind of like bullet points.




Jason AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server


SQL RNNR

Posting Performance Based Questions - Gail Shaw
Posting Data Etiquette - Jeff Moden
Hidden RBAR - Jeff Moden
VLFs and the Tran Log - Kimberly Tripp
Post #1575858
Posted Thursday, May 29, 2014 2:42 PM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 12:04 PM
Points: 13,239, Visits: 12,081
SQLRNNR (5/29/2014)
Sean Lange (5/29/2014)
Luis Cazares (5/29/2014)
JOIN keywords on the right of the tables.


+1000 That one drives me nuts!!! (ok I know it is a short trip)


NOT a fan of that format style either. At least ctrl ky fixes that.

Same with trailing commas. I dislike that practice but it is an easy one to fix with a little ctrl ky.

In case you are wondering, I dislike trailing commas because it makes it more of a pain to comment out a column if I want to test the results without the column. It also helps break up the list kind of like bullet points.


I go back and forth on the trailing commas. I don't much like the look of leading ones but I don't like the extra effort with trailing ones.


_______________________________________________________________

Need help? Help us help you.

Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

Need to split a string? Try Jeff Moden's splitter.

Cross Tabs and Pivots, Part 1 – Converting Rows to Columns
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs
Understanding and Using APPLY (Part 1)
Understanding and Using APPLY (Part 2)
Post #1575863
Posted Thursday, May 29, 2014 2:42 PM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 12:04 PM
Points: 13,239, Visits: 12,081
SQLRNNR (5/29/2014)
Sean Lange (5/29/2014)
Luis Cazares (5/29/2014)
JOIN keywords on the right of the tables.


+1000 That one drives me nuts!!! (ok I know it is a short trip)


NOT a fan of that format style either. At least ctrl ky fixes that.

Same with trailing commas. I dislike that practice but it is an easy one to fix with a little ctrl ky.

In case you are wondering, I dislike trailing commas because it makes it more of a pain to comment out a column if I want to test the results without the column. It also helps break up the list kind of like bullet points.


But what does ctrl ky do?


_______________________________________________________________

Need help? Help us help you.

Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

Need to split a string? Try Jeff Moden's splitter.

Cross Tabs and Pivots, Part 1 – Converting Rows to Columns
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs
Understanding and Using APPLY (Part 1)
Understanding and Using APPLY (Part 2)
Post #1575866
Posted Thursday, May 29, 2014 2:58 PM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Today @ 10:59 AM
Points: 21,619, Visits: 15,275
Sean Lange (5/29/2014)
SQLRNNR (5/29/2014)
Sean Lange (5/29/2014)
Luis Cazares (5/29/2014)
JOIN keywords on the right of the tables.


+1000 That one drives me nuts!!! (ok I know it is a short trip)


NOT a fan of that format style either. At least ctrl ky fixes that.

Same with trailing commas. I dislike that practice but it is an easy one to fix with a little ctrl ky.

In case you are wondering, I dislike trailing commas because it makes it more of a pain to comment out a column if I want to test the results without the column. It also helps break up the list kind of like bullet points.


But what does ctrl ky do?


it is the shortcut in sql prompt to reformat the code to match your preferences. Sure it takes some time to define your preferences, but it saves a lot of time and angst down the road.




Jason AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server


SQL RNNR

Posting Performance Based Questions - Gail Shaw
Posting Data Etiquette - Jeff Moden
Hidden RBAR - Jeff Moden
VLFs and the Tran Log - Kimberly Tripp
Post #1575873
Posted Thursday, May 29, 2014 3:02 PM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 12:04 PM
Points: 13,239, Visits: 12,081
SQLRNNR (5/29/2014)
Sean Lange (5/29/2014)
SQLRNNR (5/29/2014)
Sean Lange (5/29/2014)
Luis Cazares (5/29/2014)
JOIN keywords on the right of the tables.


+1000 That one drives me nuts!!! (ok I know it is a short trip)


NOT a fan of that format style either. At least ctrl ky fixes that.

Same with trailing commas. I dislike that practice but it is an easy one to fix with a little ctrl ky.

In case you are wondering, I dislike trailing commas because it makes it more of a pain to comment out a column if I want to test the results without the column. It also helps break up the list kind of like bullet points.


But what does ctrl ky do?


it is the shortcut in sql prompt to reformat the code to match your preferences. Sure it takes some time to define your preferences, but it saves a lot of time and angst down the road.


Had a feeling it might be sql prompt. Don't have that one. I have to use the freebie one. It does many of the same things as far as formatting.


_______________________________________________________________

Need help? Help us help you.

Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

Need to split a string? Try Jeff Moden's splitter.

Cross Tabs and Pivots, Part 1 – Converting Rows to Columns
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs
Understanding and Using APPLY (Part 1)
Understanding and Using APPLY (Part 2)
Post #1575877
« Prev Topic | Next Topic »

Add to briefcase ««12345»»»

Permissions Expand / Collapse