I need to change some data types. I have tried using the CAST keyword, but it is not fixing the issue. Any suggestions on how to re-write these two lines with CAST statements?
- Data loss might occur when casting from
VarChar(100)toVarChar(20).
Code:
SELECT TOP 1 @variableId = variableId
FROM @tempTable
- Data loss might occur when casting from
NVarChar(512)toNVarChar.
Code:
SELECT myVariable
FROM tableName
I tried doing something like the following, but still produces an error:
CAST((myVariable) as nvarchar)