c# - sql update statement conflict with foreign key -


i trying update sql table stored procedure:

set ansi_nulls on go set quoted_identifier off go  create procedure [dbo].[updatepostingstatusangel]      @postingstatusid tinyint,      @postingid int update dbo.posting set     postingstatusid = @postingstatusid postingid = @postingid 

when executing query getting error: the update statement conflicted foreign key constraint "fk_posting_paymentstatus". conflict occurred in database "jobsdb2008", table "dbo.paymentstatus", column 'paymentstatusid'.

this weird because not updating 'paymentstatusid' column don't know why gives me conflict on column. column set null , has value already. trying update postingstatusid field. idea can reason? in advance, laziale

the value stored in paymentstatusid column must not exist in paymentstatus table.

ensure postingstatusid, paymentstatusid valid id's , exist in appropriate tables.

select paymentstatusid, postingstatusid  posting postingid = @postingid 

Comments

Popular posts from this blog

php - Passing multiple values in a url using checkbox -

compilation - PHP install fails on Ubuntu 14 (make: *** [sapi/cli/php] Error 1) PHP 5.6.20 -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -