Personal preference would be a bit datatype, though the problem with this type, is that it cant be included in an index.Use a Smallint if this will be an issue and make a constraint that values must be 1,0.
"I'm living so far beyond my income that we may almost be said to be living apart
Hm... I just created index/did GROUP by on bit column.
?
------ "There's a man... He's bald and wears a short-sleeved shirt, and somehow he's very important to me. I think his name is Homer."
(Jack O'Neill, Stargate)
This works on my development machine
version is below
Microsoft SQL Server 2000 - 8.00.760 (Intel X86) Dec 17 2002 14:22:05 Copyright (c) 1988-2003 Microsoft Corporation Developer Edition on Windows NT 5.1 (Build 2600: Service Pack 1)
------ "There's a man... He's bald and wears a short-sleeved shirt, and somehow he's very important to me. I think his name is Homer."
(Jack O'Neill, Stargate)
I can group by just fine on a bit column running SP4. You can not index a bit field however. In all honesty, creating a index on a bit field makes a whole lot of no sense because the index will be ignored anyway when the server does the execution plan. A bit field will always result in a table scan.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.