Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Site Related Forums
 The Yak Corral
 The Most Persistent Microsoft SQL Server Myths

Author  Topic 

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2009-05-13 : 15:07:36
... and Why They Are Wrong:

http://www.msteched.com/online/view.aspx?tid=e3d68d12-6824-4701-b51f-a8871c59e7d7

this is a good one too.

___________________________________________________________________________
Causing trouble since 1980
Blog: http://weblogs.sqlteam.com/mladenp
Speed up SSMS development: www.ssmstoolspack.com <- version 1.5 out!

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-05-13 : 15:11:56
47 minutes?



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2009-05-13 : 15:18:16
yes. there are a lot of myths

___________________________________________________________________________
Causing trouble since 1980
Blog: http://weblogs.sqlteam.com/mladenp
Speed up SSMS development: www.ssmstoolspack.com <- version 1.5 out!
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2009-05-13 : 15:23:12
Bill's ClearTrace is mentioned as a great tool to analyze SQL Trace files.


___________________________________________________________________________
Causing trouble since 1980
Blog: http://weblogs.sqlteam.com/mladenp
Speed up SSMS development: www.ssmstoolspack.com <- version 1.5 out!
Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2009-05-13 : 15:34:08
Anyone have any favorite SQL Server myths?



CODO ERGO SUM
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2009-05-13 : 15:53:48
my top 3:
1. backups always restore with no problems.
2. CI defines ordering.
3. only sprocs save exec plans.


___________________________________________________________________________
Causing trouble since 1980
Blog: http://weblogs.sqlteam.com/mladenp
Speed up SSMS development: www.ssmstoolspack.com <- version 1.5 out!
Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2009-05-13 : 17:20:25
1) SQL uses 1 thread per data file to write data
2) Order of conditions in where clause affects how the query is run
3) Temp tables are written to disk and table variables are memory only

--
Gail Shaw
SQL Server MVP
Go to Top of Page

dinakar
Master Smack Fu Yak Hacker

2507 Posts

Posted - 2009-05-13 : 17:28:19
quote:
Originally posted by GilaMonster

1) SQL uses 1 thread per data file to write data
2) Order of conditions in where clause affects how the query is run
3) Temp tables are written to disk and table variables are memory only

--
Gail Shaw
SQL Server MVP



I see 2 and 3 a LOT ..

Dinakar Nethi
************************
Life is short. Enjoy it.
************************
http://weblogs.sqlteam.com/dinakar/
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2009-05-13 : 17:37:52
1. SQL Server can't lock rows, only pages (I've seen this published less than 3 years ago, something for Oracle)
2. SQL Server stores locks on disk, causing deadlocks/timeouts/whatever (probably because Access does this)
3. NEVER use temp tables, ALWAYS use table variables
3a. Because table variables ALWAYS stay in RAM, and temp tables NEVER leave disk
3b. Because table variables stay in RAM, it doesn't matter that you can't index them
4. There's no good documentation for SQL Server

Partial
Go to Top of Page

Transact Charlie
Master Smack Fu Yak Hacker

3451 Posts

Posted - 2009-05-14 : 04:24:18
1) My code must be set based because I'm not using a CURSOR?

Guess that's not really a database *engine* myth though.


Charlie
===============================================================
Msg 3903, Level 16, State 1, Line 1736
The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-05-14 : 04:37:10
quote:
Originally posted by GilaMonster

2) Order of conditions in where clause affects how the query is run
This is actually true for SQL Server 2005

See http://weblogs.sqlteam.com/peterl/archive/2007/09/27/SQL-Server-2005-too-smart.aspx

This is also documented in Books Online here
http://msdn.microsoft.com/en-us/library/ms143359(SQL.90).aspx
(section Transact-SQL, Expressions in queries)



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2009-05-14 : 04:40:41
yeah but i think what they usually mean is short-circuiting:
http://weblogs.sqlteam.com/mladenp/archive/2008/02/25/How-SQL-Server-short-circuits-WHERE-condition-evaluation.aspx

___________________________________________________________________________
Causing trouble since 1980
Blog: http://weblogs.sqlteam.com/mladenp
Speed up SSMS development: www.ssmstoolspack.com <- version 1.5 out!
Go to Top of Page

DonAtWork
Master Smack Fu Yak Hacker

2167 Posts

Posted - 2009-05-14 : 07:21:35
SQL Server is not for Enterprise applications. Everything should be done by .NET , not a DBA. You could use notepad to store the data.

[Signature]For fast help, follow this link:
http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspx
Learn SQL or How to sell Used Cars
For ultra basic questions, follow these links.
http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp
Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2009-05-14 : 09:46:42
quote:
Originally posted by DonAtWork
... You could use notepad to store the data...

We had a consultant a few years back who advocated getting rid of databases and storing everything in XML files.

At least we didn't try to implement that idea. After he explained his grand vision to IT management, they got rid of him the next day.





CODO ERGO SUM
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2009-05-14 : 12:56:10
That's too bad, you should have let him try it.

Wait a minute...so you've actually met Whitefang?
Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2009-05-14 : 16:52:42
quote:
Originally posted by Peso

quote:
Originally posted by GilaMonster

2) Order of conditions in where clause affects how the query is run
This is actually true for SQL Server 2005



Not quite what I meant. Was more talking about the myth that

WHERE ColA = @Var1 AND ColB = @Var2
WHERE ColB = @Var2 AND ColA = @Var1

will perform differently.


--
Gail Shaw
SQL Server MVP
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-05-14 : 16:59:44
quote:
Originally posted by GilaMonster

quote:
Originally posted by Peso

quote:
Originally posted by GilaMonster

2) Order of conditions in where clause affects how the query is run
This is actually true for SQL Server 2005



Not quite what I meant. Was more talking about the myth that

WHERE ColA = @Var1 AND ColB = @Var2
WHERE ColB = @Var2 AND ColA = @Var1

will perform differently.


--
Gail Shaw
SQL Server MVP


A MS certified teacher told me that if an index is in order ColA ColB that should be considered in WHERE-Clause.
If that is true, it makes sense to have a look at order of columns in WHERE-Clause.


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2009-05-14 : 17:44:22
quote:
Originally posted by webfred

quote:
Originally posted by GilaMonster

quote:
Originally posted by Peso

quote:
Originally posted by GilaMonster

2) Order of conditions in where clause affects how the query is run
This is actually true for SQL Server 2005



Not quite what I meant. Was more talking about the myth that

WHERE ColA = @Var1 AND ColB = @Var2
WHERE ColB = @Var2 AND ColA = @Var1

will perform differently.


--
Gail Shaw
SQL Server MVP


A MS certified teacher told me that if an index is in order ColA ColB that should be considered in WHERE-Clause.
If that is true, it makes sense to have a look at order of columns in WHERE-Clause.


No, you're never too old to Yak'n'Roll if you're too young to die.



I think SQL Server is smart enough to figure out that both columns are in the index and use the index whatever order they occur in the WHERE clause.


CODO ERGO SUM
Go to Top of Page

pootle_flump

1064 Posts

Posted - 2009-05-15 : 05:35:16
quote:
Originally posted by robvolk


4. There's no good documentation for SQL Server

I've never heard that. The docs are awesome. I thought everyone knew this.
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2009-05-15 : 06:50:25
Well, no one who posts here lately. I've had 5-6 replies in a row the past few weeks that were "check Books Online". Had more than one ask afterwards, "can you post an example or article?" They can't imagine that information could already be on their computer without needing the internet, but they also can't even Google it.
Go to Top of Page

pootle_flump

1064 Posts

Posted - 2009-05-15 : 07:07:00
Ah - you mean people are too lazy to even consider looking stuff up? Oh yes - definitely. I thought you meant people were saying "I've checked out the SQL Server docs and they suck".
Go to Top of Page
    Next Page

- Advertisement -