Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
T-SQL 4.15 KB | None | 0 0
  1. USE [RentApplicationsMonitoring]
  2. GO
  3.  
  4. /****** Object:  Table [dbo].[Tracking]    Script Date: 02/17/2011 13:52:22 ******/
  5. SET ANSI_NULLS ON
  6. GO
  7.  
  8. SET QUOTED_IDENTIFIER ON
  9. GO
  10.  
  11. CREATE TABLE [dbo].[Tracking](
  12.     [internal_id] [uniqueidentifier] NOT NULL,
  13.     [tracking_id] [nvarchar](50) NULL,
  14.     [timestamp_utc] [datetime] NULL,
  15.     [timestamp_local] [datetime] NULL,
  16.     [machine] [nvarchar](250) NULL,
  17.     [com_application_id] [uniqueidentifier] NULL,
  18.     [com_application_instance_id] [uniqueidentifier] NULL,
  19.     [com_application_name] [nvarchar](250) NULL,
  20.     [application_path] [nvarchar](250) NULL,
  21.     [application_name] [nvarchar](250) NULL,
  22.     [executing_assembly] [nvarchar](500) NULL,
  23.     [thread_id] [int] NULL,
  24.     [process_id] [int] NULL,
  25.     [vb_error_no] [bigint] NULL,
  26.     [source] [nvarchar](250) NULL,
  27.     [local_source] [nvarchar](500) NULL,
  28.     [description] [nvarchar](1000) NULL,
  29.  CONSTRAINT [PK_Tracking] PRIMARY KEY CLUSTERED
  30. (
  31.     [internal_id] ASC
  32. )WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
  33. ) ON [PRIMARY]
  34.  
  35. GO
  36.  
  37. USE [RentApplicationsMonitoring]
  38. GO
  39.  
  40. /****** Object:  Table [dbo].[RentTracking]    Script Date: 02/17/2011 13:53:25 ******/
  41. SET ANSI_NULLS ON
  42. GO
  43.  
  44. SET QUOTED_IDENTIFIER ON
  45. GO
  46.  
  47. CREATE TABLE [dbo].[RentTracking](
  48.     [internal_id] [bigint] IDENTITY(1,1) NOT NULL,
  49.     [link_id] [uniqueidentifier] NULL,
  50.     [uploader] [nvarchar](50) NULL,
  51.     [company_name] [nvarchar](250) NULL,
  52.     [company_id] [int] NULL,
  53.     [xml_file_name] [nvarchar](500) NULL,
  54.  CONSTRAINT [PK_RentTracking] PRIMARY KEY CLUSTERED
  55. (
  56.     [internal_id] ASC
  57. )WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
  58. ) ON [PRIMARY]
  59.  
  60. GO
  61.  
  62.  
  63. SET ANSI_NULLS ON
  64. GO
  65. SET QUOTED_IDENTIFIER ON
  66. GO
  67. -- =============================================
  68. -- Author:      Maciek Plewa
  69. -- Create date: 16/02/2011
  70. -- Description: Adds a new entry
  71. -- =============================================
  72. ALTER PROCEDURE spInsertEvent
  73.             @tracking_id nvarchar(50),
  74.             @timestamp_local datetime,
  75.             @machine nvarchar(250) = null,
  76.             @com_application_id uniqueidentifier = null,
  77.             @com_application_instance_id uniqueidentifier = null,
  78.             @com_application_name nvarchar(250) = null,
  79.             @application_path nvarchar(250) = null,
  80.             @application_name nvarchar(250) = null,
  81.             @executing_assembly nvarchar(500) = null,
  82.             @thread_id int = null,
  83.             @process_id int = null,
  84.             @vb_error_no bigint = null,
  85.             @source nvarchar(250) = null,
  86.             @local_source nvarchar(500) = null,
  87.             @description nvarchar(1000) = null,
  88.             @uploader nvarchar(50) = null,
  89.             @company_name nvarchar(250) = null,
  90.             @company_id int = null,
  91.             @xml_file_name nvarchar(500) = null
  92. AS
  93. BEGIN
  94.     -- SET NOCOUNT ON added to prevent extra result sets from
  95.     -- interfering with SELECT statements.
  96.     SET NOCOUNT ON;
  97.  
  98.     DECLARE @internalID uniqueidentifier
  99.     SET @internalID = newid()
  100.  
  101.     INSERT INTO [RentApplicationsMonitoring].[dbo].[Tracking]
  102.                 ([internal_id] 
  103.                    ,[tracking_id]
  104.                    ,[timestamp_utc]
  105.                    ,[timestamp_local]
  106.                    ,[machine]
  107.                    ,[com_application_id]
  108.                    ,[com_application_instance_id]
  109.                    ,[com_application_name]
  110.                    ,[application_path]
  111.                    ,[application_name]
  112.                    ,[executing_assembly]
  113.                    ,[thread_id]
  114.                    ,[process_id]
  115.                    ,[vb_error_no]
  116.                    ,[source]
  117.                    ,[local_source]
  118.                    ,[description])
  119.          VALUES
  120.                    (@internalID,   
  121.                     @tracking_id,
  122.                     GETUTCDATE(),
  123.                     @timestamp_local,
  124.                     @machine,
  125.                     @com_application_id,
  126.                     @com_application_instance_id,
  127.                     @com_application_name,
  128.                     @application_path,
  129.                     @application_name,
  130.                     @executing_assembly,
  131.                     @thread_id,
  132.                     @process_id,
  133.                     @vb_error_no,
  134.                     @source,
  135.                     @local_source,
  136.                     @description)
  137.    
  138.                    
  139.     INSERT INTO [RentApplicationsMonitoring].[dbo].[RentTracking]
  140.            ([link_id]
  141.            ,[uploader]
  142.            ,[company_name]
  143.            ,[company_id]
  144.            ,[xml_file_name])
  145.      VALUES
  146.            (@internalID
  147.            ,@uploader
  148.            ,@company_name
  149.            ,@company_id
  150.            ,@xml_file_name)
  151. END
  152. GO
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement