By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,961 Members | 1,665 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,961 IT Pros & Developers. It's quick & easy.

Basic MSSQL Query help

sethupathy22
P: 4
Hi guys,

i need to change (i guess update) the value on a specific row depending on the value of another row. Let me be more clear.

i have values in code rows and i have a choise box with actif and inactif named member

I need to set member to actif if there is any type of value in code. i have over 700 to change the value i dont want to do them manually.

Can someone help

Thank you
Feb 26 '08 #1
Share this Question
Share on Google+
2 Replies


ck9663
Expert 2.5K+
P: 2,878
Hi guys,

i need to change (i guess update) the value on a specific row depending on the value of another row. Let me be more clear.

i have values in code rows and i have a choise box with actif and inactif named member

I need to set member to actif if there is any type of value in code. i have over 700 to change the value i dont want to do them manually.

Can someone help

Thank you
Do you have two tables? You said " depending on the value of another row". Would you mind posting your sample data and your desired results?

-- CK
Feb 26 '08 #2

P: 8
Hi guys,

i need to change (i guess update) the value on a specific row depending on the value of another row. Let me be more clear.

i have values in code rows and i have a choise box with actif and inactif named member

I need to set member to actif if there is any type of value in code. i have over 700 to change the value i dont want to do them manually.

Can someone help

Thank you

try this

update <table> set memberstatus='inactif' --- set all members to inactif
update <table> set memberstatus='actif'
where valuesINcodeROWS not in ('', ' ', NULL)

hope this helps
Feb 26 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.