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 |
|
jim_jim
Constraint Violating Yak Guru
306 Posts |
Posted - 2011-04-24 : 12:43:28
|
| I am trying to delete records from a table based on a condition on the table OR based on another condition from a union of two viewsSo the query should not delete records if either condition is trueBelow is my Query and getting an errorDelete from Customer where EDate Is Not null OR(select * from TestTable1 union select * from TestTable2))Below is the error messageAn expression of non-boolean type specified in a context where a condition is expected, near ')'.Iam not sure whether my query logic is right but need help to do what I described aboveThanks |
|
|
nigelrivett
Master Smack Fu Yak Hacker
3385 Posts |
Posted - 2011-04-24 : 13:08:18
|
| Not sure from that what you are trying to do - neither is the server.Delete from Customerwhere EDate Is Not nullORcustomerID in (select customerid from TestTable1unionselect customerid from TestTable2))==========================================Cursors are useful if you don't know sql.SSIS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
jim_jim
Constraint Violating Yak Guru
306 Posts |
Posted - 2011-04-25 : 17:29:48
|
| Thank You.It worked |
 |
|
|
|
|
|