· 10 years ago · Sep 05, 2016, 07:34 AM
1USE [erm_nsu_dev]
2GO
3IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[DF_NSU_Main_Profile_Students_Guardian_info_CreatedTime]') AND type = 'D')
4BEGIN
5ALTER TABLE [dbo].[NSU_Main_Profile_Students_Guardian_info] DROP CONSTRAINT [DF_NSU_Main_Profile_Students_Guardian_info_CreatedTime]
6END
7
8GO
9IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[DF_NSU_Main_Profile_Students_Guardian_info_Status]') AND type = 'D')
10BEGIN
11ALTER TABLE [dbo].[NSU_Main_Profile_Students_Guardian_info] DROP CONSTRAINT [DF_NSU_Main_Profile_Students_Guardian_info_Status]
12END
13
14GO
15IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[DF_NSU_Main_Profile_Students_Guardian_info_Verified]') AND type = 'D')
16BEGIN
17ALTER TABLE [dbo].[NSU_Main_Profile_Students_Guardian_info] DROP CONSTRAINT [DF_NSU_Main_Profile_Students_Guardian_info_Verified]
18END
19
20GO
21IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[DF_NSU_Main_Profile_Students_Guardian_info_IsFinancer]') AND type = 'D')
22BEGIN
23ALTER TABLE [dbo].[NSU_Main_Profile_Students_Guardian_info] DROP CONSTRAINT [DF_NSU_Main_Profile_Students_Guardian_info_IsFinancer]
24END
25
26GO
27IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[DF_NSU_Main_Profile_Students_Guardian_info_IsEmergencyContactPerson]') AND type = 'D')
28BEGIN
29ALTER TABLE [dbo].[NSU_Main_Profile_Students_Guardian_info] DROP CONSTRAINT [DF_NSU_Main_Profile_Students_Guardian_info_IsEmergencyContactPerson]
30END
31
32GO
33/****** Object: Table [dbo].[NSU_Main_Profile_Students_Guardian_info] Script Date: 9/5/2016 1:30:36 PM ******/
34IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[NSU_Main_Profile_Students_Guardian_info]') AND type in (N'U'))
35DROP TABLE [dbo].[NSU_Main_Profile_Students_Guardian_info]
36GO
37/****** Object: Table [dbo].[NSU_Main_Profile_Students_Guardian_info] Script Date: 9/5/2016 1:30:36 PM ******/
38SET ANSI_NULLS ON
39GO
40SET QUOTED_IDENTIFIER ON
41GO
42IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[NSU_Main_Profile_Students_Guardian_info]') AND type in (N'U'))
43BEGIN
44CREATE TABLE [dbo].[NSU_Main_Profile_Students_Guardian_info](
45 [GuardianId] [bigint] IDENTITY(1,1) NOT NULL,
46 [StudentSerialId] [bigint] NULL,
47 [GuardianName] [nvarchar](150) NULL,
48 [GuardianOccupation] [nvarchar](150) NULL,
49 [GuardianDesignation] [nvarchar](150) NULL,
50 [GuardianNationalId] [nvarchar](150) NULL,
51 [GuardianMaritalStatus] [nvarchar](50) NULL,
52 [GuardianMobile] [int] NULL,
53 [GuardianEmail] [nvarchar](150) NULL,
54 [GuardianMailingAddress] [ntext] NULL,
55 [GuardianWorkAddress] [ntext] NULL,
56 [GuardianCountry] [nvarchar](150) NULL,
57 [GuardianDistrict] [nvarchar](150) NULL,
58 [GuardianPostalCode] [nvarchar](50) NULL,
59 [GuardianPhoneHome] [int] NULL,
60 [GuardianPhoneWork] [int] NULL,
61 [GuardianPhoneOthers] [int] NULL,
62 [GuardianFax] [nvarchar](150) NULL,
63 [RelationWithStudent] [nvarchar](100) NULL,
64 [IsEmergencyContactPerson] [bit] NULL,
65 [IsFinancer] [bit] NULL,
66 [UserName] [nvarchar](50) NULL,
67 [Password] [nvarchar](150) NULL,
68 [Salt] [nvarchar](50) NULL,
69 [TokenId] [nvarchar](50) NULL,
70 [ConfirmationCode] [nvarchar](50) NULL,
71 [ActivationCode] [nvarchar](150) NULL,
72 [Verified] [bit] NULL,
73 [Status] [bit] NULL,
74 [CreatedBy] [bigint] NULL,
75 [CreatedTime] [datetime] NULL,
76 [ModifiedBy] [bigint] NULL,
77 [ModifiedTime] [datetime] NULL,
78 CONSTRAINT [PK_NSU_Main_Students_Guardian_info] PRIMARY KEY CLUSTERED
79(
80 [GuardianId] ASC
81)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
82) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
83END
84GO
85SET IDENTITY_INSERT [dbo].[NSU_Main_Profile_Students_Guardian_info] ON
86
87GO
88INSERT [dbo].[NSU_Main_Profile_Students_Guardian_info] ([GuardianId], [StudentSerialId], [GuardianName], [GuardianOccupation], [GuardianDesignation], [GuardianNationalId], [GuardianMaritalStatus], [GuardianMobile], [GuardianEmail], [GuardianMailingAddress], [GuardianWorkAddress], [GuardianCountry], [GuardianDistrict], [GuardianPostalCode], [GuardianPhoneHome], [GuardianPhoneWork], [GuardianPhoneOthers], [GuardianFax], [RelationWithStudent], [IsEmergencyContactPerson], [IsFinancer], [UserName], [Password], [Salt], [TokenId], [ConfirmationCode], [ActivationCode], [Verified], [Status], [CreatedBy], [CreatedTime], [ModifiedBy], [ModifiedTime]) VALUES (1, 1, N'Nirman Biswas', N'Doctor', N'Professor, ENT', NULL, NULL, 1726838056, N'', N'Ibne Sina Medical College and Hospital, Shyamoli, Dhaka', NULL, NULL, NULL, NULL, 0, 0, 0, NULL, N'Father', 1, 1, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, CAST(0x0000A5A100E3E7D4 AS DateTime), NULL, NULL)
89GO
90INSERT [dbo].[NSU_Main_Profile_Students_Guardian_info] ([GuardianId], [StudentSerialId], [GuardianName], [GuardianOccupation], [GuardianDesignation], [GuardianNationalId], [GuardianMaritalStatus], [GuardianMobile], [GuardianEmail], [GuardianMailingAddress], [GuardianWorkAddress], [GuardianCountry], [GuardianDistrict], [GuardianPostalCode], [GuardianPhoneHome], [GuardianPhoneWork], [GuardianPhoneOthers], [GuardianFax], [RelationWithStudent], [IsEmergencyContactPerson], [IsFinancer], [UserName], [Password], [Salt], [TokenId], [ConfirmationCode], [ActivationCode], [Verified], [Status], [CreatedBy], [CreatedTime], [ModifiedBy], [ModifiedTime]) VALUES (2, 1, N'Sandhaya Biswas', N'Housewife', N'Professor, ENT', NULL, NULL, 1726838059, N'', N'House 48/A, Road 6/A, Dhanmondi, Dhaka 1209', NULL, NULL, NULL, NULL, 0, 0, 0, NULL, N'Mother', 1, 1, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, CAST(0x0000A5A100E3E7D7 AS DateTime), NULL, NULL)
91GO
92SET IDENTITY_INSERT [dbo].[NSU_Main_Profile_Students_Guardian_info] OFF
93GO
94IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[DF_NSU_Main_Profile_Students_Guardian_info_IsEmergencyContactPerson]') AND type = 'D')
95BEGIN
96ALTER TABLE [dbo].[NSU_Main_Profile_Students_Guardian_info] ADD CONSTRAINT [DF_NSU_Main_Profile_Students_Guardian_info_IsEmergencyContactPerson] DEFAULT ((0)) FOR [IsEmergencyContactPerson]
97END
98
99GO
100IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[DF_NSU_Main_Profile_Students_Guardian_info_IsFinancer]') AND type = 'D')
101BEGIN
102ALTER TABLE [dbo].[NSU_Main_Profile_Students_Guardian_info] ADD CONSTRAINT [DF_NSU_Main_Profile_Students_Guardian_info_IsFinancer] DEFAULT ((0)) FOR [IsFinancer]
103END
104
105GO
106IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[DF_NSU_Main_Profile_Students_Guardian_info_Verified]') AND type = 'D')
107BEGIN
108ALTER TABLE [dbo].[NSU_Main_Profile_Students_Guardian_info] ADD CONSTRAINT [DF_NSU_Main_Profile_Students_Guardian_info_Verified] DEFAULT ((0)) FOR [Verified]
109END
110
111GO
112IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[DF_NSU_Main_Profile_Students_Guardian_info_Status]') AND type = 'D')
113BEGIN
114ALTER TABLE [dbo].[NSU_Main_Profile_Students_Guardian_info] ADD CONSTRAINT [DF_NSU_Main_Profile_Students_Guardian_info_Status] DEFAULT ((0)) FOR [Status]
115END
116
117GO
118IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[DF_NSU_Main_Profile_Students_Guardian_info_CreatedTime]') AND type = 'D')
119BEGIN
120ALTER TABLE [dbo].[NSU_Main_Profile_Students_Guardian_info] ADD CONSTRAINT [DF_NSU_Main_Profile_Students_Guardian_info_CreatedTime] DEFAULT (getdate()) FOR [CreatedTime]
121END
122
123GO