Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 345
  • Last Modified:

Cannot input varchar value to changed to varchar column from int (previous)

having a table where has a column previously was assigned as int, after changing to varchar, it has the following error while inputting varchar value (eg. 314414 / 0A24)

error message :

'conversion failed when converting the varchar value to data type int sql server'
0
doramail05
Asked:
doramail05
1 Solution
 
HuaMinChenBusiness AnalystCommented:
This is a data problem. It means you can't convert one varchar into an integer properly.
0
 
doramail05Author Commented:
but (eg. 314414 / 0A24) is a varchar sample data

not sure the reason why it couldnt enter into a changed to varchar column from int
0
 
HuaMinChenBusiness AnalystCommented:
There is cast to do the conversion and please the data type of the column is varchar.
0
What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

 
Sreedhar VengalaSr. Consultant - Business IntelligenceCommented:
You should be able to enter the data into Varchar Column which is been changed from Int to Varchar.   Just check again the table design and make sure the column is changed from varchar from int and is been saved properly.
0
 
doramail05Author Commented:
i guess it is,

even if i script it,

it also shows that it is a varchar(50) column
0
 
HuaMinChenBusiness AnalystCommented:
I think there is a cast somewhere, like in the trigger of the table, which is doing the conversion and leads to this problem now.
0
 
Anthony PerkinsCommented:
Unfortunately we are not sitting at your computer so unless you can post your table schema and the SQL query you are executing we can only provide wild guesses.
0
 
ZberteocCommented:
Does the table have a trigger or a computed column?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now