ODBC Connector Multiple update Queries
Posted: Fri Nov 10, 2017 4:55 pm
Hello,
I am using ODBC connector stage to connect to Azure SQL Server and execute the 2 update statement in sequence as below:
UPDATE HWP.WRK_VHEW_VOL
SET EXP_DT = '2017-11-09' , STG_FL='D'
FROM HWP.WRK_VHEW_VOL A
WHERE EXISTS
(
SELECT 1 FROM HWP.WRK_VHEW_VOL B
WHERE A.ID=B.ID
AND B.STG_FL='D'
)
AND A.Start_DT < '2017-11-09'
AND A.EXP_DT = '9999-12-31';
UPDATE HWP.WRK_VHEW_VOL
SET EXP_DT = DATEAdd(Day, -1,'2017-11-09')
FROM HWP.WRK_VHEW_VOL A
WHERE EXISTS
(
SELECT 1 FROM HWP.WRK_VHEW_VOL B
WHERE A.ID=B.ID
AND B.STG_FL='U'
)
AND A.Start_DT < '2017-11-09'
AND A.EXP_DT = '9999-12-31';
The Job is finishing successfully but only 1st query is getting executed. The 2nd query does not trigger.
I executed both the queries using SQL server management Studio and it executes both the queries one after another.
Can you please let me know if there is a limitation in the ODBC connector(User-defined SQL) that I can pass only 1 query in the Statements Box or have done anything wrong.
Regards
Neeraj
[Edit: removed the orange highlighting so the red part would stand out more - Andy (especially since I'm colorblind!)]
I am using ODBC connector stage to connect to Azure SQL Server and execute the 2 update statement in sequence as below:
UPDATE HWP.WRK_VHEW_VOL
SET EXP_DT = '2017-11-09' , STG_FL='D'
FROM HWP.WRK_VHEW_VOL A
WHERE EXISTS
(
SELECT 1 FROM HWP.WRK_VHEW_VOL B
WHERE A.ID=B.ID
AND B.STG_FL='D'
)
AND A.Start_DT < '2017-11-09'
AND A.EXP_DT = '9999-12-31';
UPDATE HWP.WRK_VHEW_VOL
SET EXP_DT = DATEAdd(Day, -1,'2017-11-09')
FROM HWP.WRK_VHEW_VOL A
WHERE EXISTS
(
SELECT 1 FROM HWP.WRK_VHEW_VOL B
WHERE A.ID=B.ID
AND B.STG_FL='U'
)
AND A.Start_DT < '2017-11-09'
AND A.EXP_DT = '9999-12-31';
The Job is finishing successfully but only 1st query is getting executed. The 2nd query does not trigger.
I executed both the queries using SQL server management Studio and it executes both the queries one after another.
Can you please let me know if there is a limitation in the ODBC connector(User-defined SQL) that I can pass only 1 query in the Statements Box or have done anything wrong.
Regards
Neeraj
[Edit: removed the orange highlighting so the red part would stand out more - Andy (especially since I'm colorblind!)]