Click here to Skip to main content
16,020,568 members
Home / Discussions / Database
   

Database

 
GeneralRe: ADO sql server Pin
Russell Jones6-Nov-06 5:50
Russell Jones6-Nov-06 5:50 
GeneralRe: ADO sql server Pin
Russell Jones6-Nov-06 5:53
Russell Jones6-Nov-06 5:53 
QuestionDivide by zero error encountered.??? how?? [urgent] Pin
campbells2-Nov-06 21:48
campbells2-Nov-06 21:48 
AnswerRe: Divide by zero error encountered.??? how?? [urgent] Pin
ChandraRam2-Nov-06 22:33
ChandraRam2-Nov-06 22:33 
Questionbinary bit manipulation - possible? Pin
neilsolent2-Nov-06 21:41
neilsolent2-Nov-06 21:41 
AnswerRe: binary bit manipulation - possible? Pin
Mike Dimmick3-Nov-06 3:22
Mike Dimmick3-Nov-06 3:22 
GeneralRe: binary bit manipulation - possible? Pin
neilsolent3-Nov-06 3:44
neilsolent3-Nov-06 3:44 
GeneralRe: binary bit manipulation - possible? Pin
neilsolent4-Nov-06 7:18
neilsolent4-Nov-06 7:18 
I have worked out how to do this, so I thought I should post the answer here in case anyone is interested:

INSERT INTO TEST VALUES(0)

/* Turn bit 137 on */
UPDATE TEST SET TEST1 = CONVERT(binary(32), STUFF(TEST1, 137 / 8 + 1, 1, CONVERT(binary(1), SUBSTRING(TEST1, 137 / 8 + 1, 1) | POWER(2, 137 % 8))))

/* Test bit 137 value */
SELECT SUBSTRING(TEST1, 137 / 8 + 1, 1) & POWER(2, 137 % 8) FROM TEST

/* Turn bit 137 off */
UPDATE TEST SET TEST1 = CONVERT(binary(32), STUFF(TEST1, 137 / 8 + 1, 1, CONVERT(binary(1), SUBSTRING(TEST1, 137 / 8 + 1, 1) & ~POWER(2, 137 % 8))))





cheers,
Neil

AnswerRe: binary bit manipulation - possible? Pin
Eric Dahlvang3-Nov-06 3:44
Eric Dahlvang3-Nov-06 3:44 
GeneralRe: binary bit manipulation - possible? Pin
neilsolent3-Nov-06 3:49
neilsolent3-Nov-06 3:49 
GeneralRe: binary bit manipulation - possible? Pin
Eric Dahlvang3-Nov-06 5:07
Eric Dahlvang3-Nov-06 5:07 
GeneralRe: binary bit manipulation - possible? Pin
neilsolent3-Nov-06 5:22
neilsolent3-Nov-06 5:22 
QuestionInformix DB Lvarchar(500) Pin
Vipin.d2-Nov-06 17:14
Vipin.d2-Nov-06 17:14 
AnswerRe: Informix DB Lvarchar(500) Pin
Colin Angus Mackay3-Nov-06 0:18
Colin Angus Mackay3-Nov-06 0:18 
QuestionTwo data sources from XML to one DataGridView Pin
kevfoo2-Nov-06 6:42
kevfoo2-Nov-06 6:42 
QuestionORA-01008: not all variables bound - ADO.NET Pin
sri_con32-Nov-06 6:07
sri_con32-Nov-06 6:07 
AnswerRe: ORA-01008: not all variables bound - ADO.NET Pin
Jim Conigliaro2-Nov-06 6:40
Jim Conigliaro2-Nov-06 6:40 
GeneralRe: ORA-01008: not all variables bound - ADO.NET Pin
sri_con33-Nov-06 5:36
sri_con33-Nov-06 5:36 
GeneralRe: ORA-01008: not all variables bound - ADO.NET Pin
sri_con310-Nov-06 1:09
sri_con310-Nov-06 1:09 
QuestionSerious SQL question for MS Access... [modified] Pin
new_phoenix2-Nov-06 5:17
new_phoenix2-Nov-06 5:17 
AnswerRe: Serious SQL question for MS Access... Pin
TheRealRhodieboy3-Nov-06 6:13
TheRealRhodieboy3-Nov-06 6:13 
Questionhow to use logical expressions in mdx query Pin
cellardoor07162-Nov-06 4:53
cellardoor07162-Nov-06 4:53 
QuestionHow many records are “a lot of records”? Pin
theJazzyBrain2-Nov-06 4:08
theJazzyBrain2-Nov-06 4:08 
Questionlarge data in SQL server Pin
Sunil Lanke2-Nov-06 1:23
Sunil Lanke2-Nov-06 1:23 
AnswerRe: large data in SQL server Pin
Paddy Boyd2-Nov-06 2:58
Paddy Boyd2-Nov-06 2:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.