?
Solved

Conversion failed when converting the varchar value 'my_field_name' to data type bit

Posted on 2009-04-30
7
Medium Priority
?
1,037 Views
Last Modified: 2012-05-06
I have a table on sql2005 that gives me an error on one field when I update a row or delete a row...
the error is:

Conversion failed when converting the varchar value 'my_field_name' to data type bit

any ideas on what could be causing this
this particular field is set with a default value of ((0)) and is a bit datatype

I have other bit fields on the same table that work fine.
0
Comment
Question by:H-SC
7 Comments
 
LVL 143

Assisted Solution

by:Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3] earned 672 total points
ID: 24270610
any trigger on the table?
0
 
LVL 75

Assisted Solution

by:Aneesh Retnakaran
Aneesh Retnakaran earned 664 total points
ID: 24270633
check the other variables/ columns mentioned  on the where part . (Post your exact query for better assistance )
0
 
LVL 1

Author Comment

by:H-SC
ID: 24270719
AngelIII,

there are no triggers on this table.  That was one of the things that I thought would be the issue and checked before posting..
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 1

Author Comment

by:H-SC
ID: 24270736
aneeshattingal,

the inserts, updates and del are all being done in enterprise mgr directly on the table.
0
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 24270801
can you just write a query and try it from the query analyser
0
 
LVL 41

Assisted Solution

by:Sharath
Sharath earned 664 total points
ID: 24270851
Provide your exact query. May be you are doing somethin wrong like keeping the column name in single quotes in the WHERE clause.
WHERE 'my_field_name' = 1
If this is the case, you will get the error. remove the quotes around the column name. instead of we assume like this better provide your query.
0
 
LVL 1

Accepted Solution

by:
H-SC earned 0 total points
ID: 24278884
I got this to work by changing the name of the field on the table from "send" to "snd",
tried to put brackets around send on the table like [send] but as I save the table, they go away, so I asumed that "send" would be accaptable to use as a field name.  
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have a large data set and a SSIS package. How can I load this file in multi threading?
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Suggested Courses

862 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