I have an issue trying to insert records in temporary tables
I have a temporary table #TmpCapacityTable
CapacityDate InstallerCode WorkAreadID FoxtelCodeID value
2/8/12 BAW 7 1510 3
2/8/12 BAW 7 1508 3
Second temporary table #TmpAdjustmentTable
CapacityDate InstallerCode WorkAreadID fFoxtelCodeID value
2/8/12 BAW 7 1510 1
2/8/12 BAW 7 1508 1
2/8/12 BAW 7 1509 1
I need to insert into #TmpCapacityTable those rows that are not in but there are in #TmpAdjustmentTable, in the sample only code 1509
I’m using
Insert into #TmpCapacityTable
select * from #TmpAdjustmentTable
where #TmpAdjustmentTable.CapacityDate not in (select #TmpCapacityTable.CapacityDate from #TmpCapacityTable)
and #TmpAdjustmentTable.WorkAreadID not in (select #TmpCapacityTable.WorkAreadID from #TmpCapacityTable)
and #TmpAdjustmentTable.InstallerCode not in (select #TmpCapacityTable.InstallerCode from #TmpCapacityTable)
and #TmpAdjustmentTable.FoxtelCodeID not in (select #TmpCapacityTable.FoxtelCodeID from #TmpCapacityTable)
but it doesn’t work, I can’t see what the problem is
Can Someone help me pleaseeee!!!
Thanks in advance
Eliana
1 Answer