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 123»»»

Bit data Expand / Collapse
Author
Message
Posted Tuesday, May 6, 2008 9:50 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: Thursday, September 25, 2014 1:21 PM
Points: 3,143, Visits: 139
Comments posted to this topic are about the item Bit data
Post #496045
Posted Wednesday, May 7, 2008 4:09 AM
SSChasing Mays

SSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing Mays

Group: General Forum Members
Last Login: Saturday, March 19, 2011 12:37 PM
Points: 603, Visits: 63
The question did not mention SQL 2005.
My answer was for SQL 2000.
Oh well.
Post #496164
Posted Wednesday, May 7, 2008 4:41 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, June 10, 2009 10:50 PM
Points: 120, Visits: 211
hi

i am using sql 2000, then the answer is wrong

Post #496183
Posted Wednesday, May 7, 2008 6:59 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Thursday, June 26, 2014 6:11 AM
Points: 1,330, Visits: 815
The question does specifically request the results from SQL Server 2005.
Post #496270
Posted Wednesday, May 7, 2008 7:18 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Thursday, November 20, 2014 3:20 PM
Points: 2,409, Visits: 2,818
jim.powers (5/7/2008)
The question does specifically request the results from SQL Server 2005.


Yes, it does.

What will be the result when the following query is executed on SQL Server 2005?


Also, and this depends on knowing the sample databases, but AdventureWorks is one of the new sample databases for SQL 2005.

Reference:
http://blog.sqlauthority.com/2007/05/23/sql-server-2005-northwind-database-or-adventureworks-database-samples-databases/



-------------------
"Operator! Give me the number for 911!" - Homer Simpson

"A SQL query walks into a bar and sees two tables. He walks up to them and says 'Can I join you?'"
Ref.: http://tkyte.blogspot.com/2009/02/sql-joke.html
Post #496294
Posted Wednesday, May 7, 2008 7:33 AM
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: Thursday, September 25, 2014 1:21 PM
Points: 3,143, Visits: 139
I was very careful to specify SQL 2005 because SQL 2000 behaves differently.

I was inspired to post this question because one of my students used WHERE = 'true' for a bit column. I tested that in SQL 2000 and it did not work, so I told the student he was wrong. However, when I tested that in SQL 2005, it worked.

I was not trying to trick anyone, since I explicitly specified SQL 2005, and found an example from the AdventureWorks database.

)
Post #496307
Posted Wednesday, May 7, 2008 7:37 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Monday, November 17, 2014 12:50 PM
Points: 13,872, Visits: 9,598
It's a good question and gives all the necessary information.

- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread

"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
Post #496314
Posted Wednesday, May 7, 2008 8:33 AM
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: Thursday, July 17, 2014 10:56 AM
Points: 3,924, Visits: 1,607
WHERE SalariedFlag = 'true' for bit would not work in 2000 but since it says use Adventureworks, it clear that the question is for SQL 2005.

SQL DBA.
Post #496383
Posted Wednesday, May 7, 2008 8:43 AM
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: Thursday, September 25, 2014 1:21 PM
Points: 3,143, Visits: 139
True.

And I explicitly said "2005" in the body of the question.

)
Post #496398
Posted Wednesday, May 7, 2008 8:57 AM


SSC-Insane

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

Group: General Forum Members
Last Login: Today @ 1:42 AM
Points: 20,799, Visits: 32,717
Just a problem with some people not reading the entire question. The question did specifically state SQL Server 2005.

Good question, everything specified to be able to make an educated guess at the answer.

Well done.




Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
Post #496412
« Prev Topic | Next Topic »

Add to briefcase 123»»»

Permissions Expand / Collapse