![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Could anyone shead some light on this problem that I'm faced with. I have a stored procedure that has 2 parameters. The first is the primary key for the table that is to be updated. The second is an integer. This integer is actually a bitwise status flag.(1=locked, 2=reviewed, 4=invalid...) The issue that I am facing is that I need to change the value for a large number of fields within this particular table, but only modify the relevant bits. For example record1 has a value of 4 in it's statusA field which means it is marked as invalid but not locked and not reviewed. Record1 has a value of 5 in it's statusB field which means it is marked as invalid and locked but not reviewed. The stored procedure then passes the primary key to select record1 and an integer value of 1, thereby indicating that the "locked" bit of the statusA and statusB fields should be set. How can I do this? |
#3
| |||
| |||
|
|
Could anyone shead some light on this problem that I'm faced with. I have a stored procedure that has 2 parameters. The first is the primary key for the table that is to be updated. The second is an integer. This integer is actually a bitwise status flag.(1=locked, 2=reviewed, 4=invalid...) The issue that I am facing is that I need to change the value for a large number of fields within this particular table, but only modify the relevant bits. For example record1 has a value of 4 in it's statusA field which means it is marked as invalid but not locked and not reviewed. Record1 has a value of 5 in it's statusB field which means it is marked as invalid and locked but not reviewed. The stored procedure then passes the primary key to select record1 and an integer value of 1, thereby indicating that the "locked" bit of the statusA and statusB fields should be set. How can I do this? |
#4
| |||
| |||
|
#5
| |||
| |||
|
|
Could anyone shead some light on this problem that I'm faced with. I have a stored procedure that has 2 parameters. The first is the primary key for the table that is to be updated. The second is an integer. This integer is actually a bitwise status flag.(1=locked, 2=reviewed, 4=invalid...) The issue that I am facing is that I need to change the value for a large number of fields within this particular table, but only modify the relevant bits. For example record1 has a value of 4 in it's statusA field which means it is marked as invalid but not locked and not reviewed. Record1 has a value of 5 in it's statusB field which means it is marked as invalid and locked but not reviewed. The stored procedure then passes the primary key to select record1 and an integer value of 1, thereby indicating that the "locked" bit of the statusA and statusB fields should be set. How can I do this? |
#6
| |||
| |||
|
|
Because there are so many columns that have to be updated, I was hoping that I wouldn't have to do a select statement to retrieve the existing values of those columns first. |
![]() |
| Thread Tools | |
| Display Modes | |
| |