Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. CREATE TABLE [dbo].[ErrorLogTable]
  2. (
  3. [ErrorID] [bigint] IDENTITY(1,1) NOT NULL PRIMARY KEY,
  4. [ErrorNumber] [nvarchar](50) NOT NULL,
  5. [ErrorDescription] [nvarchar](4000) NULL,
  6. [ErrorProcedure] [nvarchar](100) NULL,
  7. [ErrorState] [int] NULL,
  8. [ErrorSeverity] [int] NULL,
  9. [ErrorLine] [int] NULL,
  10. [ErrorTime] [datetime] NULL
  11. );
  12.  
  13. CREATE PROCEDURE [dbo].[ErrorLogInsert]
  14. AS
  15.  
  16. INSERT INTO [ErrorLogTable]
  17. (
  18. ErrorNumber
  19. ,ErrorDescription
  20. ,ErrorProcedure
  21. ,ErrorState
  22. ,ErrorSeverity
  23. ,ErrorLine
  24. ,ErrorTime
  25. )
  26. VALUES
  27. (
  28. ERROR_NUMBER()
  29. ,ERROR_MESSAGE()
  30. ,ERROR_PROCEDURE()
  31. ,ERROR_STATE()
  32. ,ERROR_SEVERITY()
  33. ,ERROR_LINE()
  34. ,GETDATE()
  35. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement