sql - Conversion failed when converting the nvarchar value 'newValue' to data type int -


i'm pretty sure inserting correct data. have drop indexes, triggers, constraint make sure nothing intervening insert.

here's catch: field i'm trying insert has datatype of int changed nvarchar(100) later. know should into?

this table structure

    create table [dbo].[mytable.values](     [mytableid] [bigint] not null,     [mytablecode] [nvarchar](100) not null,     [code] [nvarchar](100) not null,     [value] [nvarchar](250) not null,     [id] [bigint] identity(1,1) not null,     [updatebyid] [bigint] not null,     [updatedate] [datetime] not null,  constraint [pk_mytable.values] primary key clustered  (     [mytablecode] asc,     [code] asc,     [id] asc )with (pad_index = off, statistics_norecompute = off, ignore_dup_key = off, `allow_row_locks = on, allow_page_locks = on) on [primary]` ) on [primary] 

and script insert

insert [dbo].[mytable.values] (         [mytableid]         ,[mytablecode]         ,[code]         ,[value]         ,[updatebyid]         ,[updatedate]         )     values (         581         ,'myparenttablecode'         ,'mytablenewcode'         ,'mytablenewcode'         ,5197         ,getdate()         ) 

thanks looking this, have found out 1 of our view using "with schemabinding" clause. , view casting field "code" int. here view.

create view [dbo].[vsomeview] schemabinding select id, cast(code int) [code], mytablecode dbo.[mytable.values] mytablecode '%abc' , isnumeric(code) = 1 

Comments

Popular posts from this blog

java - How to specify maven bin in eclipse maven plugin? -

single sign on - Logging into Plone site with credentials passed through HTTP -

php - Why does AJAX not process login form? -