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.
| Author |
Topic |
|
de9625
Starting Member
17 Posts |
Posted - 2004-03-23 : 12:32:58
|
| This might not be the right forum since I need to do this against a DB2 database but hope someone could help me. This is what I want to do:SELECT id, flagWHERE (integer(flag) & 8) = 8Im not sure if this even works with SQL Server? Any suggestions? |
|
|
aiken
Aged Yak Warrior
525 Posts |
Posted - 2004-03-23 : 12:35:23
|
| select id,flagfrom whateverwhere (flag & 8) = 8Though really, this is a performance nightmare because it can't take advantage of indexing, so you'll get lots of table scans. Much better to use a join table of attributes rather than trying to save the few bytes by packing them into bits, IMHO.Cheers-b |
 |
|
|
de9625
Starting Member
17 Posts |
Posted - 2004-03-23 : 12:37:36
|
I can't do much about the database. |
 |
|
|
|
|
|