has anyone moved from the datadirect driver to the...
# cfml-general
c
has anyone moved from the datadirect driver to the ms jdbc one for mssql?
m
I believe we have with all our prod and non-prod CF 2021 servers (driver class
com.microsoft.sqlserver.jdbc.SQLServerDriver
). What's your question?
c
i was trying to see how our code works on those drivers, and an existing query seems to fail so far that it doesnt return anything back to the variable, but query does run. this is the sanitized orig part of the query that seemed to be affecting it
if object_Id('tempdb.dbo.##TEMPTABLENAME') is not null
Drop table ##TEMPTABLENAME;
but when i tested and updated it to use if exists, it was just fine
DROP TABLE IF EXISTS ##TEMPTABLENAME;
m
possible that ##TEMPTABLENAME is residing someplace other than tempdb.dbo ? That's all I got.
c
its wild bc the adobe provided driver works, but ms jdbc, and the cfquery does not return a value. like if i try to dump it right after, its just not even there.
m
I would create ##TEMPTABLE however your code is currently doing it, then query the various system databases until you can verify exactly what db/schema the temp table is under, just to be certain. Why it would be created in a certain place under one driver and a different place with a different driver is unusual, but to start by knowing where the table "is" (fully qualified), is to ensure you have a foundation for then troubleshooting further.
d
i was unable to use the mssql driver (instead of the one provided by datadirect) in cf back in 2014 because there was a problem with how it returns results from query batches. if the last statement in the batch didn't return a value then the query result was undefined. it's interesting that your query result does exist if the condition is removed and only the drop executes. i dont remember where i read about this discrepancy in the drivers... does anyone else remember this?