88
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
1 USE [master]
|
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
2 GO
|
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
3 /****** Object: Database [FileMonitoring] Script Date: 01/13/2011 19:12:24 ******/
|
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
4 CREATE DATABASE [FileMonitoring]
|
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
5 GO
|
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
6 USE [FileMonitoring]
|
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
7 GO
|
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
8 /****** Object: Table [dbo].[FileEvents] Script Date: 01/13/2011 19:12:25 ******/
|
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
9 SET ANSI_NULLS ON
|
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
10 GO
|
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
11 SET QUOTED_IDENTIFIER ON
|
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
12 GO
|
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
13 SET ANSI_PADDING ON
|
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
14 GO
|
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
15 CREATE TABLE [dbo].[FileEvents](
|
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
16 [Id] [int] IDENTITY(1,1) NOT NULL,
|
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
17 [FileEvent] [varchar](50) NOT NULL,
|
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
18 [CreateTimestamp] [smalldatetime] NULL,
|
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
19 CONSTRAINT [PK_FileEvents] PRIMARY KEY CLUSTERED
|
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
20 (
|
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
21 [Id] ASC
|
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
22 )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
|
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
23 ) ON [PRIMARY]
|
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
24 GO
|
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
25 SET ANSI_PADDING OFF
|
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
26 GO
|
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
27 /****** Object: StoredProcedure [dbo].[FileEvents_insert] Script Date: 01/13/2011 19:12:31 ******/
|
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
28 SET ANSI_NULLS ON
|
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
29 GO
|
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
30 SET QUOTED_IDENTIFIER ON
|
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
31 GO
|
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
32 -- =============================================
|
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
33 -- Author: OSL
|
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
34 -- Create date: 12/01/2011
|
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
35 -- Description: Demo for OSL
|
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
36 -- =============================================
|
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
37 CREATE PROCEDURE [dbo].[FileEvents_insert]
|
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
38 -- Add the parameters for the stored procedure here
|
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
39 @FileEvent VARCHAR(50), @Id INT OUTPUT
|
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
40 AS
|
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
41 BEGIN
|
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
42 SET NOCOUNT ON;
|
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
43
|
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
44 -- Insert statements for procedure here
|
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
45 INSERT dbo.FileEvents (FileEvent) SELECT @FileEvent
|
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
46
|
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
47 SELECT @Id = SCOPE_IDENTITY()
|
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
48 END
|
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
49 GO
|
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
50 /****** Object: Default [DF_FileEvents_CreateTimestamp] Script Date: 01/13/2011 19:12:25 ******/
|
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
51 ALTER TABLE [dbo].[FileEvents] ADD CONSTRAINT [DF_FileEvents_CreateTimestamp] DEFAULT (getdate()) FOR [CreateTimestamp]
|
stevenhollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
52 GO
|