Re: Help in writing a trigger

Tech-Archive recommends: Fix windows errors by optimizing your registry



SqlBeginner (SqlBeginner@xxxxxxxxxxxxxxxxxxxxxxxxx) writes:
BEGIN CATCH
Print ('Do error handling or logging here.')
END CATCH

But you better implement that error handling, or else the error will be
swallowed. Since this is in a trigger, the transaction will be doomed,
and you will get an error anyway. However, it would be a generic error,
leaving you clueless of what the real problem is.


--
Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

.



Relevant Pages

  • Re: Database logging with IIS 7.0
    ... I'll see if I can reproduce with sql 2008. ... I am trying to setup database logging with IIS 7. ... Logging to a remote SQL Server and logging to a local SQL Express ... Tried all the three SQL Server ODBC clients (SQL Server, ...
    (microsoft.public.inetserver.iis)
  • Re: ISA Server Logging Questions
    ... > They both use per-entry logging to SQL and will both stop serving requests if the logging destination fails. ... > This is not limited to SQL logging; if text or database logging fails, then ISA will stop serving requests. ... > 3) The only database supported for loggin is SQL Server. ...
    (microsoft.public.isa)
  • Re: Simple, I hope
    ... Steve gave me the SQL statement, which I understand, ... the same syntax mentioned by Steve in his earlier post. ... code for each of your modules where you write the UPDATE queries. ... only have to have one set of error handling, and you do need to include ...
    (microsoft.public.access.forms)
  • Re: Transactions - rollback
    ... problem is with SQL Server's error handling. ... Kalen Delaney's Inside SQL and Erland Sommarskog's articles on ... > Transaction count after EXECUTE indicates that a COMMIT or ROLLBACK ... > COMMIT TRAN ...
    (microsoft.public.sqlserver.server)
  • Re: move ISA 2004 logging to SQL 2005?
    ... If the SQL server goes down, like for its monthly patching, the ISA firewall ... logging device becomes available. ...
    (microsoft.public.isa)