sql - INSERT INTO an Integer after Insert -
i have big problem , need help!
i have trigger on table table a
updates few lines , @ end making insert into
table table b
data table table a
have trigger on it.
everything fine, have int column docid
in table b
can't fill int
column table (verid)
. if insert nvarchar
variable column docid
, it's working. can take nvarchar
field vom table a
, insertit in int
column docid
. no way int
int
. here code:
declare @stichwortid varchar(50) select @stichwortid= isnull(verid,'') inserted insert [dbo].[baufin_kostenstellen] (docid, dwkeyword) values(@stichwortid, 'test')
also trying declare @stiwchwortid
int
didn't work either. filling second column dwkeyword
no problem.
how using insert . . . select
?
insert [dbo].[baufin_kostenstellen] (docid, dwkeyword) select verid, 'test' inserted;
your code, written, should work. despite statement otherwise, culprit data type different in 2 tables -- can cause other sorts of problems.
Comments
Post a Comment