Does anyone know of a way to suppress the error messages while executing a stored procedure in MSSQL. Basically I don't want it yelling at me becuase the primary_key is invalid. I am using the @@ERROR object to do my own error catching and such. But when executing a SP from if it errors out it kills the program calling it, becuase of server error. Any help would be greatly appreciated.
Good programming practice is to check data validity before trying to insert it into a table. If a critical error occurs it will stop execution for the batch, so if you want to continue processing you need to separate batches (with GO statements) or enclose them in transactions.