Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: SQL-Server
hi all
i want to update all my rows in a table except one row , i have tried that code but it didn't affect in any row ,
 
update tbl_account
set DefaultEmp='False'
where (tbl_account.Id <> 3) and DeptId=5
could you please help me...
 
Thanks
Posted 29-May-12 22:05pm
moon20111.1K
Comments
Om Prakash Pant at 30-May-12 4:22am
   
if your table has primary key then this should be simple
RDBurmon at 30-May-12 4:47am
   
Hello Moon , Please post your table structure and data in tbl_account. It would be helpful to understand the scenario and easy for member to provide effective answer .
djj55 at 30-May-12 9:16am
   
Does tbl_account.ID have any nulls?
Kaushik Saha from Kolkata,India at 18-Jul-12 1:22am
   
It means you want to update all data which Dept_ID=5 except which ID=3.
ypur DML query work above operation.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 359
1 Richard MacCutchan 310
2 OriginalGriff 290
3 Sharmanuj 146
4 Jared Sanow 145
0 Sergey Alexandrovich Kryukov 5,969
1 OriginalGriff 5,005
2 CPallini 2,473
3 Richard MacCutchan 1,547
4 Abhinav S 1,507


Advertise | Privacy | Mobile
Web03 | 2.8.140814.1 | Last Updated 30 May 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100