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 |
scelamko
Constraint Violating Yak Guru
309 Posts |
Posted - 2008-03-26 : 15:29:11
|
Guys,I have a weired issue here insert into select [value] from cfg_elements WHERE ELEMENT_NAME='REPORT_ARBITRATOR_EVENTTYPCDS'--- result '45','95'when I run the following subquery I get resultsselect * from employee where employee_typ in ('45', '95')--- I get 4 rowsbut when I run the below statement I do not get any resultsselect * from employee where employee_typ in (select [value] from cfg_elements WHERE ELEMENT_NAME='REPORT_ARBITRATOR_EVENTTYPCDS')Any suggestions and inputs would helpThanks |
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2008-03-26 : 15:35:35
|
tryselect t.*from employee tjoin (select distinct [value] from cfg_elements WHERE ELEMENT_NAME='REPORT_ARBITRATOR_EVENTTYPCDS') t2on t.employee_typ = t2.[value]andselect * from employee where employee_typ in (select [value] from cfg_elements WHERE ELEMENT_NAME='REPORT_ARBITRATOR_EVENTTYPCDS' where value is not null)If that doesn't help check the datatypes.==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
|
|