February 24, 2009 at 4:09 pm
Alvin Ramard (2/24/2009)
hmmmm.....First there was The Thread.
Then came Son of the Thread.
NO!!!!!!
No, no, no, Bride of the Thread was next, then Son of the Thread, then Ghost of the Thread, then Daughter of the Thread and then the Thread Meets Abbott & Costello.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
February 24, 2009 at 4:16 pm
All hail The Thread.
Mighty, Mighty is The Thread.
All-Knowing, All-Merciful....
Is this the beginning of a Cult of the ThreadHeads?
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
February 24, 2009 at 7:42 pm
Bob Hovious (2/24/2009)
ThreadHeads?
Steve,
I think you just got a new level for SSC, ThreadHead!:D If you have 100 posts on The Thread you become a ThreadHead!
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
February 24, 2009 at 9:58 pm
Somehow I get the feeling I don't want to encourage that level.:P
February 25, 2009 at 2:30 am
Steve
How about some SQL Server Central ThreadHead window clings!
Rodders...
February 25, 2009 at 7:54 am
Since this thread is the most popular here, I would like to ask everyone if we should have some standard while answering questions. For instance some of us, including me dont specify Schema qualifier. Or we dont use Alias when Joining.
The reason I bring this up is that usually half of these guys/ladies asking questions are newbies. So if we can provide the right standard, maybe they will continue using it.
What do you ladies and gents think about that?
-Roy
February 25, 2009 at 8:02 am
I think that there is virtually no chance that we are going to agree on that standard, or that Steve would want to spend his time trying to enforce it.
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
February 25, 2009 at 8:13 am
I would venture to guess that the majority of the posters on this thread would be folks that use schema qualification and aliases all the time.
I know I try to post code using what I consider best practices and best format (I know there will be varying opinions on this, but anyone who disagrees with me is wrong :P), and schema qualification and aliasing tables are in my best practice list.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
February 25, 2009 at 8:17 am
I agree with Jack and Barry. Yes, I try to post that way all the time. No, I don't think we need to get into sweating standards like that.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
February 25, 2009 at 8:17 am
We could have a thread here that fights out the best practice list and we can provide a final list to the Newbies. π
-Roy
February 25, 2009 at 8:41 am
Grant Fritchey (2/25/2009)
I agree with Jack and Barry. Yes, I try to post that way all the time. No, I don't think we need to get into sweating standards like that.
Don't you get the impression sometimes that the OP's want his query / sproc / function whatever to look as big and complicated as possible? Quite often I take the time to convert a chunk of code to using table aliases simply so I can get it small enough to reel the whole thing into my walnut-sized brain, but the OP's often completely ignore it. 'Course it's 'good practice', but it don't half help to follow what a bit of code is supposed to be doing!
Nevertheless, I'd stick with Grant on this one and keep it voluntary. It's all part of the learning curve innit.
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
February 25, 2009 at 8:47 am
How about a forum just covering Best Practices ?
February 25, 2009 at 8:48 am
What is "best practices" actually? What is "best" today may not be "best" a week, or month, or year from now.
As to using schema qualifiers or table aliases in posted code, should be done, even with single table queries. Also, well formated and consistant coding of SQL would be nice. Some of us have servers that are case-sensitive, so getting code that looks like this requires modification before working on it:
Declare @myVariable int;
SET @myvariable = 2;
update Mytable set
curval=Curval*@MyVariable
SELECT * from mytable JOIN MyTable2 on col1=colz Where col2 = 'A'
And yes, I have seen code similiar to this and worse. How many of us have looked at posted code that ran almost everything together with no real formatting at all? If we have to reformat code before working on it, most of us don't.
I won't push for a standard, but will push for consistancy. If you are going to use all CAPITALS for reserved words, do it for all RESERVED words. If you are using Mixed Case, again be consistant. If you name a variable @MyVariable, code it that way through out your code, even if you are using a case-insensitive collation. The same goes with table and column names, please be consistant when typing your code. If you are consistant, I think it looks more professional.
As I do use a case-sensitive collation, it forces me to be consistant with naming of variables, tables, columns, etc.
February 25, 2009 at 8:50 am
Could be very useful to newbies - Things like thou shalt not use cursors (unless there is no other way - There is you just need to think a bit more π )
February 25, 2009 at 8:52 am
Although some 'Best Practices' will change there are more that won't - Can't see it ever being anything but best practice to avoid code like
INSERT myTable
SELECT * FROM myOtherTable
Viewing 15 posts - 1,951 through 1,965 (of 66,712 total)
You must be logged in to reply to this topic. Login to reply