I'm having a weird query issue with SQL server...
The following query inserts two rows into the query_results
table:
------------------------------------------------------------
insert into ENQUIRE.dbo.QUERY_RESULTS ( QUERYID, ENTITY_ID )
SELECT DISTINCT 1933 AS QUERYID, A.ENTITY_ID
FROM BIOTAB1 A
inner join WEBREPORTS.dbo.TB912 TB912 on A.ENTITY_ID=TB912.ENTITYID
-- inner join WEBREPORTS.dbo.TB967 TB967 on A.ENTITY_ID=TB967.ENTITYID
WHERE 1=1
AND A.PRIMARY_RECORD_STATUS IN ('A','-')
AND EXISTS (
SELECT 1 FROM AFFIL X
WHERE X.ENTITY_ID = A.ENTITY_ID AND X.RECORD_TYPE IN ('TS')
)
AND
(
1=0 OR
(
1=1 and TB912.MAILCODE IN ('YAN')
-- ) OR (
-- 1=1 and TB967.EVENTCDE IN ('AF000055')
)
)
------------------------------------------------------------
That's correct behavior. If I run the select statement by
itself, it returns 2 records.
But if I uncomment the three lines that are commented out, the
query only inserts ONE record.
The SELECT statement run by itself (with the commented out
lines uncommented) returns two records.
Why won't it insert the two records?
I'm just running this stuff in SQL Server Management Studio,
but the results from Coldfusion are the same.
Rick
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Get involved in the latest ColdFusion discussions, product
development sharing, and articles on the Adobe Labs wiki.
http://labs/adobe.com/wiki/index.php/ColdFusion_8
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:291974
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4