本文介绍了选择查询返回一个bizard错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



i有一个简单的SQL查询当我执行它时会给我一个错误:

查询:选择canceltype,来自canceltype的值,其中companyid = 1且geolocationid = 1且Canceltype = 1



错误:消息245,级别16,状态1,行1

将nvarchar值''Shortage of Vehicle''转换为数据类型int时转换失败。



表结构:



  CREATE   TABLE  [dbo]。[CancelType ](
[id] [ int ] IDENTITY 1 1 NOT NULL
[CancelType] [ nvarchar ]( 50 NULL
[Value] [ int ] NULL
[Companyid] [ int ] NULL
[Geolocationid] [ int ] NULL
[CType] [ int ] NULL
ON [ PRIMARY ]





请帮帮我

解决方案

hi all,

i have an simple sql query when i excute it is returning me an error:
Query:select canceltype,value from canceltype where companyid=1 and geolocationid= 1 and Canceltype=1

error:Msg 245, Level 16, State 1, Line 1
Conversion failed when converting the nvarchar value ''Shortage of Vehicle'' to data type int.

Table Structure:

CREATE TABLE [dbo].[CancelType](
    [id] [int] IDENTITY(1,1) NOT NULL,
    [CancelType] [nvarchar](50) NULL,
    [Value] [int] NULL,
    [Companyid] [int] NULL,
    [Geolocationid] [int] NULL,
    [CType] [int] NULL
) ON [PRIMARY]



pls help me out

解决方案


这篇关于选择查询返回一个bizard错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-21 09:56