· 10 years ago · Sep 03, 2016, 09:28 AM
1USE [erm_nsu_sims]
2GO
3IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[DF_NSU_Main_Profile_Students_Documents_CreatedTime]') AND type = 'D')
4BEGIN
5ALTER TABLE [dbo].[NSU_Main_Profile_Students_Documents] DROP CONSTRAINT [DF_NSU_Main_Profile_Students_Documents_CreatedTime]
6END
7
8GO
9IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[DF_NSU_Main_Profile_Students_Documents_Status]') AND type = 'D')
10BEGIN
11ALTER TABLE [dbo].[NSU_Main_Profile_Students_Documents] DROP CONSTRAINT [DF_NSU_Main_Profile_Students_Documents_Status]
12END
13
14GO
15/****** Object: Table [dbo].[NSU_Main_Profile_Students_Documents] Script Date: 9/3/2016 3:24:37 PM ******/
16IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[NSU_Main_Profile_Students_Documents]') AND type in (N'U'))
17DROP TABLE [dbo].[NSU_Main_Profile_Students_Documents]
18GO
19/****** Object: Table [dbo].[NSU_Main_Profile_Students_Documents] Script Date: 9/3/2016 3:24:37 PM ******/
20SET ANSI_NULLS ON
21GO
22SET QUOTED_IDENTIFIER ON
23GO
24IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[NSU_Main_Profile_Students_Documents]') AND type in (N'U'))
25BEGIN
26CREATE TABLE [dbo].[NSU_Main_Profile_Students_Documents](
27 [DocumentId] [bigint] IDENTITY(1,1) NOT NULL,
28 [ModuleId] [bigint] NULL,
29 [DocumentTypeId] [int] NULL,
30 [DocumentName] [nvarchar](150) NULL,
31 [Extension] [nvarchar](50) NULL,
32 [Location] [ntext] NULL,
33 [Remarks] [ntext] NULL,
34 [StudentSerialId] [bigint] NULL,
35 [Status] [bit] NULL,
36 [CreatedBy] [bigint] NULL,
37 [CreatedTime] [datetime] NULL,
38 [ModifiedBy] [bigint] NULL,
39 [ModifiedTime] [datetime] NULL,
40 CONSTRAINT [PK_NSU_Main_Profile_Students_Documents] PRIMARY KEY CLUSTERED
41(
42 [DocumentId] ASC
43)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
44) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
45END
46GO
47SET IDENTITY_INSERT [dbo].[NSU_Main_Profile_Students_Documents] ON
48
49GO
50INSERT [dbo].[NSU_Main_Profile_Students_Documents] ([DocumentId], [ModuleId], [DocumentTypeId], [DocumentName], [Extension], [Location], [Remarks], [StudentSerialId], [Status], [CreatedBy], [CreatedTime], [ModifiedBy], [ModifiedTime]) VALUES (1, 0, 4, N'photo0', N'.jpeg', N'/Documents/Profile/Student/photo0.jpeg', N'', 1, 0, 0, CAST(0x0000A5A20093AE5E AS DateTime), NULL, NULL)
51GO
52INSERT [dbo].[NSU_Main_Profile_Students_Documents] ([DocumentId], [ModuleId], [DocumentTypeId], [DocumentName], [Extension], [Location], [Remarks], [StudentSerialId], [Status], [CreatedBy], [CreatedTime], [ModifiedBy], [ModifiedTime]) VALUES (2, 0, 4, N'photo0', N'.jpeg', N'/Documents/Profile/Student/photo0.jpeg', N'', 1, 0, 0, CAST(0x0000A5A200945A3E AS DateTime), NULL, NULL)
53GO
54INSERT [dbo].[NSU_Main_Profile_Students_Documents] ([DocumentId], [ModuleId], [DocumentTypeId], [DocumentName], [Extension], [Location], [Remarks], [StudentSerialId], [Status], [CreatedBy], [CreatedTime], [ModifiedBy], [ModifiedTime]) VALUES (10002, 0, 16, N'photo5', N'.jpg', N'/Documents/Profile/Student/photo5.jpg', N'', 5, 0, 0, CAST(0x0000A66B00F7B2C3 AS DateTime), NULL, NULL)
55GO
56INSERT [dbo].[NSU_Main_Profile_Students_Documents] ([DocumentId], [ModuleId], [DocumentTypeId], [DocumentName], [Extension], [Location], [Remarks], [StudentSerialId], [Status], [CreatedBy], [CreatedTime], [ModifiedBy], [ModifiedTime]) VALUES (10006, 0, 16, N'photo7', N'.jpg', N'/Documents/Profile/Student/photo7.jpg', N'', 7, 0, 0, CAST(0x0000A66B01472B03 AS DateTime), NULL, NULL)
57GO
58INSERT [dbo].[NSU_Main_Profile_Students_Documents] ([DocumentId], [ModuleId], [DocumentTypeId], [DocumentName], [Extension], [Location], [Remarks], [StudentSerialId], [Status], [CreatedBy], [CreatedTime], [ModifiedBy], [ModifiedTime]) VALUES (10007, 0, 16, N'photo0', N'.jpg', N'/Documents/Profile/Student/photo0.jpg', N'', 2, 0, 0, CAST(0x0000A66B01477472 AS DateTime), NULL, NULL)
59GO
60INSERT [dbo].[NSU_Main_Profile_Students_Documents] ([DocumentId], [ModuleId], [DocumentTypeId], [DocumentName], [Extension], [Location], [Remarks], [StudentSerialId], [Status], [CreatedBy], [CreatedTime], [ModifiedBy], [ModifiedTime]) VALUES (10008, 0, 16, N'photo8', N'.jpg', N'/Documents/Profile/Student/photo8.jpg', N'', 8, 0, 0, CAST(0x0000A66B015BD3CB AS DateTime), NULL, NULL)
61GO
62INSERT [dbo].[NSU_Main_Profile_Students_Documents] ([DocumentId], [ModuleId], [DocumentTypeId], [DocumentName], [Extension], [Location], [Remarks], [StudentSerialId], [Status], [CreatedBy], [CreatedTime], [ModifiedBy], [ModifiedTime]) VALUES (20002, 0, 17, N'ssc0', N'.jpg', N'/Documents/Profile/Student/ssc0.jpg', N'', 1, 0, 10004, CAST(0x0000A6750159D011 AS DateTime), NULL, NULL)
63GO
64INSERT [dbo].[NSU_Main_Profile_Students_Documents] ([DocumentId], [ModuleId], [DocumentTypeId], [DocumentName], [Extension], [Location], [Remarks], [StudentSerialId], [Status], [CreatedBy], [CreatedTime], [ModifiedBy], [ModifiedTime]) VALUES (20003, 0, 17, N'ssc0', N'.jpg', N'/Documents/Profile/Student/ssc0.jpg', N'', 1, 0, 10004, CAST(0x0000A6750159F520 AS DateTime), NULL, NULL)
65GO
66SET IDENTITY_INSERT [dbo].[NSU_Main_Profile_Students_Documents] OFF
67GO
68IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[DF_NSU_Main_Profile_Students_Documents_Status]') AND type = 'D')
69BEGIN
70ALTER TABLE [dbo].[NSU_Main_Profile_Students_Documents] ADD CONSTRAINT [DF_NSU_Main_Profile_Students_Documents_Status] DEFAULT ((0)) FOR [Status]
71END
72
73GO
74IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[DF_NSU_Main_Profile_Students_Documents_CreatedTime]') AND type = 'D')
75BEGIN
76ALTER TABLE [dbo].[NSU_Main_Profile_Students_Documents] ADD CONSTRAINT [DF_NSU_Main_Profile_Students_Documents_CreatedTime] DEFAULT (getdate()) FOR [CreatedTime]
77END
78
79GO