[Solved] String or binary data would be truncated IN SQL Server Management Studio [closed]


There are some issue with your insert statement

  1. The column ZID is INT and you are passing 12 as string like ’12’ you can remove ' but it won’t give an error.

  2. The column CID is Varchar(2) and you are trying to insert 3 character string 'ASD' it will give a data truncation error. ie your error here

  3. But if you fix the above error another one will pop-up like Conversion failed when converting date and/or time from character string. It is with the Date format you are giving for HIREDATE column 'JAN-10-1999'. SQL can take date format in MM/dd/yyyy or yyyy-MM-dd etc. the format you specified cannot be converted automatically to date format by SQL. So try 01/10/1999 or 1999-01-10..else try something with CONVERT() function

MSD DOC for CONVERT function

1

solved String or binary data would be truncated IN SQL Server Management Studio [closed]