I have a column of varchar(50)
that I want to convert to int
using this line of code:
ALTER TABLE [Table].[dbo].[example]
ALTER COLUMN XYZ int
I eyeballed the contents of column XYZ
and they look like integers that never exceed 9999.
I'm familiar with the debugger in Visual Studio and know how to step through code. However, when I try to use the SQL Server Mgmt. Studio debugger, I do not know how to zero in on and fix the field that throws this error:
Conversion failed when converting the varchar value 'XYZ' to data type int.
The query runs for about 1 minute, seeming to work, but then the above error pops up.