Dear Community
I have the following scenario or SQL query in a workflow data assignment:
SELECT [title] FROM [RV - system data] WHERE DW_ID_LONG = GV_Standard_Aufwandkonto_Nr
Variables/-types used:
Database field => DW_ID_LONG = Text (NVARCHAR(12))
Global workflow variable => GV_Standard_Aufwandkonto_Nr = Numeric
From an SQL perspective, the following applies in principle:
Generally MSSQL will transfer data from a varchar field to an INT (numeric field) as an implicit conversion - meaning that you do not need to specify a conversion. You will however need to pay careful attention to decimal places if you use an INT (numeric field).
(From <https://support.docuware.com/en-US/forums/help-with-technical-problems/c3e2967b-2d36-ea11-8454-0003ff59ab14>)
Accordingly, and assuming that the database field DW_ID_LONG only contains integer values in the range of -2147483648 and 2147483648, I believe that in the case of a pure WHERE comparison, no explicit data type conversion (e.g. using CAST (DW_ID_LONG as INT)) is necessary and the two variables can be compared directly with each other despite natively different data types.
Basically, the whole thing seems to work, but due to internal discussions with colleagues, opinions differ and I would like to ask for opinions and/or experiences from the community.
Best regards
Guido