Hi All,
I have a merge procedure which runs fine
and the condition for when matched is like this
WHEN MATCHED
AND
tODS_StoreTraffic.NumVisits <> tODS_StoreTrafficStg.NumVisits
AND
(
(tODS_StoreTrafficStg.TrafficExceptionId IS NOT NULL AND tODS_StoreTrafficStg.NumVisits < @Threshold)
)
THEN
UPDATE
SET
tODS_StoreTraffic.NumVisits = tODS_StoreTrafficStg.NumVisits,
ModifiedDate= GETDATE(),
ModifiedUser=SUSER_NAME()
This condition runs fine, Not i have to add one more case to this condition
such as
AND
tODS_StoreTraffic.NumVisits <> tODS_StoreTrafficStg.NumVisits
AND
(
(tODS_StoreTrafficStg.TrafficExceptionId IS NULL AND tODS_StoreTrafficStg.NumVisits > @Threshold)
)
THEN
UPDATE
SET
tODS_StoreTraffic.OrigVisits = tODS_StoreTrafficStg.NumVisits
I am unable to use these 2 conditions in a single when matched case, can someone please help me with this?
Thanks.
I have a merge procedure which runs fine
and the condition for when matched is like this
WHEN MATCHED
AND
tODS_StoreTraffic.NumVisits <> tODS_StoreTrafficStg.NumVisits
AND
(
(tODS_StoreTrafficStg.TrafficExceptionId IS NOT NULL AND tODS_StoreTrafficStg.NumVisits < @Threshold)
)
THEN
UPDATE
SET
tODS_StoreTraffic.NumVisits = tODS_StoreTrafficStg.NumVisits,
ModifiedDate= GETDATE(),
ModifiedUser=SUSER_NAME()
This condition runs fine, Not i have to add one more case to this condition
such as
AND
tODS_StoreTraffic.NumVisits <> tODS_StoreTrafficStg.NumVisits
AND
(
(tODS_StoreTrafficStg.TrafficExceptionId IS NULL AND tODS_StoreTrafficStg.NumVisits > @Threshold)
)
THEN
UPDATE
SET
tODS_StoreTraffic.OrigVisits = tODS_StoreTrafficStg.NumVisits
I am unable to use these 2 conditions in a single when matched case, can someone please help me with this?
Thanks.