[Last Call] Learn how to a build a cloud-first strategyRegister Now

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

Conversion failed when converting the varchar value xxx ti data type int

I am trying to do a simple update to an INT column "Status"  in a table TestValues in a database "TestTrigger" to test a trigger. Mouse over the Status name in the SQL Server Management Studio SQL editor confirms the Status is INT. What am i doing wrong?

USE TestTrigger
GO
UPDATE TestValues
SET Status = 9
WHERE RecondID = "61"

I've tried quoting the 9 value, and declaring a local variable.
0
KWDave
Asked:
KWDave
2 Solutions
 
radcaesarCommented:
Is the recordID Int field?

USE TestTrigger
GO
UPDATE TestValues SET Status = 9 WHERE RecondID = 61
GO
0
 
gladfellowCommented:
In your WHERE clause 'WHERE RecondID = "61"':

What is the data type of RecondID column. Is that int? Further, why is the value on the RHS (right hand side) enclosed in double quotes ("61").

Some more details of the table definition would help.

- Venkat
0
 
Kalyanum Deepak KumarCommented:
Yes ,if the RecordId is INT, the double quotes dont givethe result.
0
 
dqmqCommented:
Except for the double quotes, there is nothing wrong with THAT code.  Please reveal the trigger--that is the code that likely contains the error.
0
 
KWDaveAuthor Commented:
Simple error for the first time using the technology. dqmq pointed me in the right direction.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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