ALTER PROC [dbo].[SP_mm_NS] (
@ID NVARCHAR(60),
@ReturnCode NVARCHAR(30) OUTPUT,
@ErrorMessage NVARCHAR(2000) OUTPUT
)
AS
BEGIN
DECLARE
@rtnCode NVARCHAR(30),
@rtnText NVARCHAR(2000)
DECLARE
@P_BillID NVARCHAR(60),
@P_LineItemNo INTEGER
SELECT @rtnCode = ‘0‘ ,@rtnText = ‘‘
BEGIN TRY
SELECT * FROM dbo.MDMS_Account
END TRY
BEGIN CATCH
SET @rtnText= ‘ ERROR_PROCEDURE=‘+ ERROR_PROCEDURE()
+‘, ERROR_LINE=‘+convert(varchar(10), ERROR_LINE())
+‘, ERROR_NUMBER=‘+ convert(varchar(10), ERROR_NUMBER())
+‘, ERROR_MESSAGE=‘+left(ERROR_MESSAGE(), 255)
SET @rtnCode=‘1‘
END CATCH
L_END:
SELECT @ReturnCode = @rtnCode, @ErrorMessage = @rtnText
END