I'm breaking my head over this one. I keep getting the error. I followed the resolutions on the other questions but nothing works for me. I really hope someone can correct me here.
All I want is to get the data out of a view
SELECT Table_view.Information
FROM Table_View
but I keep getting this error
Conversion failed when converting the varchar value ',' to data type int
I tried the following:
SELECT Table_View.Information
FROM Table_View
WHERE Table_View.Information NOT LIKE '%,%'
SELECT Table_View.Information
CASE WHEN CAST(Table_View.Information AS INT) = 1 THEN 'space'
ELSE CONVERT(VARCHAR, Table_View.Information) END
FROM Table_View
SELECT CAST (REPLACE(REPLACE(Table_View.Information, ' ,', ' '),'/', '') AS VARCHAR)
FROM Table_View
SELECT CONVERT(VARCHAR, REPLACE(REPLACE(Table_View.Information, ' ,', ' '),'/', ''))
FROM Table_View
SELECT Table_View.Information
CASE
WHEN Table_View.Information NOT LIKE '%,%' THEN CAST(Table_View.Information AS VARCHAR)
END
FROM Table_View
None of the above helps me resolve the issue. Any suggestions? I tried cast, convert, case, replace..
selectquery. You need to fix the view definition. - Gordon Linoff