“Conversion failed when converting the varchar value 'NULL' to data type int”

后端 未结 4 910

When I insert records into a long table,I am getting the error \"Conversion failed when converting the varchar value \'NULL\' to data type int\" How can I determine which co

4条回答
  •  梦谈多话
    2021-01-02 13:48

    Do you need to fix the data or can you just convert nulls to 0's for that insert?

    If you can just convert, you could wrap your varchars that are getting converted with an ISNULL function. Just put the following around any values that are inserting into int fields.

    ISNULL(col1,0)
    

提交回复
热议问题