Solved

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

Posted on 2014-04-03
8
322 Views
Last Modified: 2014-04-08
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
Comment
Question by:doramail05
8 Comments
 
LVL 10

Expert Comment

by:HuaMinChen
Comment Utility
This is a data problem. It means you can't convert one varchar into an integer properly.
0
 
LVL 1

Author Comment

by:doramail05
Comment Utility
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
 
LVL 10

Expert Comment

by:HuaMinChen
Comment Utility
There is cast to do the conversion and please the data type of the column is varchar.
0
 
LVL 9

Expert Comment

by:Sreedhar Vengala
Comment Utility
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
Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
LVL 1

Author Comment

by:doramail05
Comment Utility
i guess it is,

even if i script it,

it also shows that it is a varchar(50) column
0
 
LVL 10

Expert Comment

by:HuaMinChen
Comment Utility
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
 
LVL 75

Expert Comment

by:Anthony Perkins
Comment Utility
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
 
LVL 26

Accepted Solution

by:
Zberteoc earned 500 total points
Comment Utility
Does the table have a trigger or a computed column?
0

Featured Post

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Join & Write a Comment

I wrote this interesting script that really help me find jobs or procedures when working in a huge environment. I could I have written it as a Procedure but then I would have to have it on each machine or have a link to a server-related search that …
Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now