this is a generic stored procedure:
CREATE PROCEDURE [daab_UpdateCustomers]
(
@CustomerID nchar(5),
@CompanyName nvarchar(40),
@ContactName nvarchar(30) = NULL,
@ContactTitle nvarchar(30) = NULL,
@Address nvarchar(60) = NULL,
@City nvarchar(15) = NULL,
@Region nvarchar(15) = NULL,
@PostalCode nvarchar(10) = NULL,
@Country nvarchar(15) = NULL,
@Phone nvarchar(24) = NULL,
@Fax nvarchar(24) = NULL
)
AS
BEGIN
SET NOCOUNT ON
DECLARE @Err int
UPDATE [dbo].[Customers]
SET
[CustomerID] = @CustomerID,
[CompanyName] = @CompanyName,
[ContactName] = @ContactName,
[ContactTitle] = @ContactTitle,
[Address] = @Address,
[City] = @City,
[Region] = @Region,
[PostalCode] = @PostalCode,
[Country] = @Country,
[Phone] = @Phone,
[Fax] = @Fax
WHERE
SET @Err = @@Error
RETURN @Err
END
GO
is it possible to raise an error/throw an exception that the c# application calling the stored procedure can catch? thanks.
Start Free Trial