Created
June 24, 2018 19:41
-
-
Save lest-xu/5e1d8f3be409e98667b7504a9c31d7df to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
USE MyDB | |
Go | |
CREATE PROCEDURE [dbo].[usp_GetSuppliers] | |
AS | |
BEGIN | |
--Declare Local Variables | |
DECLARE @Procedure_Name varchar(100), | |
@Error_Num int, | |
@Error_Message varchar(1000) | |
BEGIN TRY | |
SELECT [Id] | |
,[CompanyName] | |
,[ContactName] | |
,[ContactTitle] | |
,[City] | |
,[Country] | |
,[Phone] | |
,[Fax] | |
FROM [MyDB].[dbo].[Supplier] | |
ORDER BY CAST(Id AS INT) | |
END TRY | |
BEGIN CATCH | |
SET @Error_Num = ERROR_NUMBER() | |
SET @Error_Message = ERROR_MESSAGE() | |
RAISERROR(@Error_Message,15,1,@Procedure_Name) WITH NOWAIT, SETERROR | |
END CATCH | |
END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment