Okay, here's a weird one.
I was going through some documents and found some recommended coding practices for Oracle (this does relate to this forum, I promise!). When going through it, I noticed a couple of things which are essentially the anti-thesis of my SQL Server coding practices.
This confuses me, so I thought I'd ask if you agree or disagree with this list (and why) when coding in SQL Server.
These aren't all the ones on the list. Just the ones that confused me or contradicted the way I write my T-SQL. Anyone care to comment? I'm all for learning new things.
Catadmin - MCDBA, MCSA
"No, no. Yes. No, I tried that. Yes, both ways. No, I don't know. No again. Are there any more questions?"
-- Xena, "Been There, Done That"
I was going through some documents and found some recommended coding practices for Oracle (this does relate to this forum, I promise!). When going through it, I noticed a couple of things which are essentially the anti-thesis of my SQL Server coding practices.
This confuses me, so I thought I'd ask if you agree or disagree with this list (and why) when coding in SQL Server.
OraclePracticesList said:1) Make sure you code unqualified SQL, i.e., no table owner specified in the FROM clause
[blue]I hope this just refers to the "From dbo.Publishers" verses "From Publishers" part of the code instead of the whole S.D.O.T. stuff[/blue]
2) Instead of coding an inlist within your where clause, code it as an equal and an or (e.g. Where state = 'IL' or state = 'CA' rather than Where state in ('IL','CA')
[blue]That just feels wrong to me. Or maybe I'm just lazy DBA... @=)[/blue]
3) Try the NOT EXISTS clause rather than the NOT IN or HAVING within the Where clause
4) Using Oracle Functions will invalidate the index and can cause a full table scan
[blue]I must admit I don't have a clue on the last one. Does the same thing happen within SQL? I haven't seen that kind of behavior before.[/blue]
These aren't all the ones on the list. Just the ones that confused me or contradicted the way I write my T-SQL. Anyone care to comment? I'm all for learning new things.
Catadmin - MCDBA, MCSA
"No, no. Yes. No, I tried that. Yes, both ways. No, I don't know. No again. Are there any more questions?"
-- Xena, "Been There, Done That"