# Procedure: uspPrintError

## Properties

Property | Value
--- | ---
Name | uspPrintError
ID | 37575172
Schema | dbo
Owner | dbo
Type | SQL STORED PROCEDURE
Execute As | Caller
Encrypted |
ANSI NULLS |
Uses Quoted Identifier |
Published |
Schema Published |
Execution Replicated |
Replication Serializable Only |
Skips Replication Constraints |
Is Recompiled |
Uses Database Collation |
Null on Null Input |
MS Shipped |
Modify Date | 8/8/2010 5:21:43 PM
Create Date | 8/8/2010 5:21:43 PM

## Extended Properties

Name | Value
--- | ---
MS_Description | Prints error information about the error that caused execution to jump to the CATCH block of a TRY...CATCH construct. Should be executed from within the scope of a CATCH block otherwise it will return without printing any error information.

## Permissions

No object level permissions defined.

## Parameters

No procedure parameters defined.

## Objects that depend on [uspPrintError]

- dbo.uspPrintError
  - dbo.uspLogError
    - HumanResources.uspUpdateEmployeeHireInfo
    - HumanResources.uspUpdateEmployeeLogin
    - HumanResources.uspUpdateEmployeePersonalInfo
    - Production.WorkOrder
      - Production.iWorkOrder
      - Production.uWorkOrder
      - Production.WorkOrderRouting
    - Purchasing.PurchaseOrderDetail
      - Purchasing.iPurchaseOrderDetail
      - Purchasing.uPurchaseOrderDetail
    - Purchasing.PurchaseOrderHeader
      - Purchasing.uPurchaseOrderHeader
    - Purchasing.Vendor
      - dbo.ufnGetContactInformation
      - Purchasing.dVendor
      - Purchasing.ProductVendor
      - Purchasing.vVendorWithAddresses
      - Purchasing.vVendorWithContacts
    - Sales.SalesOrderDetail
      - Sales.iduSalesOrderDetail
      - Sales.ufn_SalesByStore
    - Sales.SalesOrderHeader
      - Sales.SalesOrderHeaderSalesReason
      - Sales.uSalesOrderHeader
      - Sales.vSalesPersonSalesByFiscalYears

## Objects on which [uspPrintError] depends

- dbo.uspPrintError

## SQL

Script
SET ANSI_NULLS ON SET QUOTED_IDENTIFIER ON CREATE PROCEDURE [dbo].[uspPrintError] AS BEGIN SET NOCOUNT ON; PRINT 'Error ' + CONVERT(varchar(50), ERROR_NUMBER()) + ', Severity ' + CONVERT(varchar(5), ERROR_SEVERITY()) + ', State ' + CONVERT(varchar(5), ERROR_STATE()) + ', Procedure ' + ISNULL(ERROR_PROCEDURE(), '-') + ', Line ' + CONVERT(varchar(5), ERROR_LINE()); PRINT ERROR_MESSAGE(); END; EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Prints error information about the error that caused execution to jump to the CATCH block of a TRY...CATCH construct. Should be executed from within the scope of a CATCH block otherwise it will return without printing any error information.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'uspPrintError'

#### See also

List of Procedures