473,418 Members | 2,333 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,418 software developers and data experts.

Conversion failed when converting the varchar value to data type bit.

31
When I try to insert values into an existing table, I am getting the following error. The table is not in bit data type format and neither is the target table. Conversion failed when converting the varchar value 'JOHN KUCHTA' to data type bit. Please help.
JOELL
Aug 15 '10 #1

✓ answered by NeoPa

No worries Joell. We all started somewhere.

With code like this though, particularly with SELECT *, I think we'll need some meta-data for the two tables. Please list all the fields in both tables and give their data types. I can't promise much as my SQL Server (T-SQL) is a bit rusty, but if it's something I can see I'll be happy to help.

5 6676
NeoPa
32,556 Expert Mod 16PB
You want us to find the problem with your code without seeing the code?

Come on. Let's start with the basics at least.
Aug 15 '10 #2
Joell
31
I am sorry I didnt send before. I am new to this type of help.

Here is my simple code:

INSERT PROF
select * from Chicaco_TEST


I have now checked all of the BIT data types and none of them are NULL. I dont know why the error message says it is a BIT type when neither the source or target table for that field is data type BIT.
Aug 15 '10 #3
NeoPa
32,556 Expert Mod 16PB
No worries Joell. We all started somewhere.

With code like this though, particularly with SELECT *, I think we'll need some meta-data for the two tables. Please list all the fields in both tables and give their data types. I can't promise much as my SQL Server (T-SQL) is a bit rusty, but if it's something I can see I'll be happy to help.
Aug 16 '10 #4
Joell
31
Thank you for your help. I completed started over and made the insert using all fields instead of using the * for all. Populating a value for each field worked. I appreciate the help.
Aug 16 '10 #5
NeoPa
32,556 Expert Mod 16PB
You're too kind Joell. It seems you responded well to a little nudge, and managed to find a solution on your own. Good for you :)
Aug 16 '10 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Saso Zagoranski | last post by:
Hi! I have created an SqlCommand object and I have set some parameters to it... One of the parameters is of the DateTime type; here is the code: sqlCommand.Parameters.Value =...
1
by: Sebastian Mark | last post by:
Did anyone got error like that? When I'm trying to Update WebReference in my project this is an error I'm getting "Custom tool error: Failed to generate dataset. Undefined data type:...
4
by: darrel | last post by:
I'm getting this error: Arithmetic overflow error converting numeric to data type numeric. Triggered on this line of my code: objOleDbAdapter.Fill(DS, "rss") Everything works when this is...
1
by: sonata | last post by:
I am trying to compare two fields which are char data typr. BUT the comparision must be arithemetic in nature. so i tried to cast both the data base field and my parameter field to big int...
2
by: Hulikal | last post by:
Hi, I using the following query select dateadd(s, 1185255439727, '01-01-1970 05:30:00') on MSSQL 2005. I get the error Arithmetic overflow error converting expression to data type...
5
by: ITCraze | last post by:
Please Guys help me out , as I need the solution of this problem very fast.Please help me. My table contains a varchar field which contains time like : 04:09PM Now the problem is that I have...
2
by: bipinskulkarni | last post by:
Hi, i have a field createdby with datatype GUID. In following query ,i encountered with the error "Conversion failed when converting from a character string to uniqueidentifier" select...
9
by: gggram2000 | last post by:
I need some help, cant figure out the error. SqlConnection dbConnection = new SqlConnection(xmldb); dbConnection.Open(); string sql = "SELECT InvStatus FROM SaleReceipts Where AccNum = '" +...
1
by: vertigo262 | last post by:
This is driving me crazy I run this query in the sql management studio and it works fine. but seems like it doesn't work in the stored procedure Can I not use a LIKE '%' in an integer field? ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.