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

Popular posts from this blog

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - UML - How would you draw a try catch in a sequence diagram? -

c++ - No viable overloaded operator for references a map -