All pastes #497780 Raw Edit

b0nn

public sql v1 · immutable
·published 2007-05-20 02:01 UTC
rendered paste body
create trigger chk_team on teamsfor insert, update asdeclare @chkCountry as char(2)select @chkCountry = (select country from INSERTED)-- if @@ROWCOUNT =0 RETURNIf @chkCountry NOT IN	(select distinct country from teams)BEGIN	raiserror('Impossible country entered', 16, 1)	ROLLBACK TRANSACTIONEND