go create trigger insAssset on tblAssets for insert as begin if exists( select A.ARNumber from tblAssets as A inner join inserted as N on A.AssetID=N.AssetID where A.ARNumber=N.ARNumber ) begin print 'The asset already exist in the database' rollback transaction return end else commit transaction print 'Asset added to the database.' end
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)