You need to inquiry about @@error after each dml statement, mainly ins, upd, del, create table, etc.
If you are working with SQL Server 2005 / 2008, then check BEGIN TRY ... END TRY BEGIN CATCH ... END CATCH block, which is the new way to catch errors.
AMB
Proposed as answer byChirag ShahMonday, March 2, 2009 8:44 PM