Click here to Skip to main content
15,885,366 members
Articles / Database Development / SQL Server

SQL - Pivot with Grand Total Column and Row

Rate me:
Please Sign up or sign in to vote.
4.76/5 (22 votes)
16 Aug 2018CPOL3 min read 200K   66   33
SQL Dynamic Pivots

Introduction

Microsoft SQL Server has introduced the PIVOT and UNPIVOT commands as enhancements to T-SQL with the release of Microsoft SQL Server 2005. Pivot Table in SQL has the ability to display data in custom aggregation. PIVOT rotates a table-valued expression by turning the unique values from one column in the expression into multiple columns in the output, and performs aggregations where they are required on any remaining column values that are wanted in the final output. UNPIVOT performs the opposite operation to PIVOT by rotating columns of a table-valued expression into column values.

More information on Pivot.

In this article, I’m concentrating on how to display Grand Total row and column for the pivot table as shown in the below grid view:

Image 1

Here in the grid, I’m showing the number of matches played by a team in each month. At last, I need to show the grand total for each team (Last column) - this total gives the year count for the teams. In the same way, I need a grand total row as last row in grid, which will give the number of matches played by all the teams for that particular month.

Background

Usually as a .NET developer, first I will get the pivot table from the stored procedure to dataset and grand total row and column. I will manipulate in the C#/ VB code using Datatable (Datatable compute method for better performance). But in this article, I want to show how to get the grand total row and column from the stored procedure, so that we can directly display data in the grid without any manipulation in the C#/VB.

How It Works

Here I’m using pivot with dynamic columns, most questions were about the column list in the PIVOT statement. This list is fixed, but many times the new columns are determined by the report at a later stage. This problem is easily solved when we mix pivots with dynamic SQL, so here is a very simple script about how to dynamically generate the pivot statement:

SQL
DECLARE @cols NVARCHAR (MAX)
SELECT @cols = COALESCE (@cols + ',[' + colName + ']', '[' + colName + ']')
FROM    Table1
WHERE	Conditions
ORDER BY colName

PRINT @cols

The above script gives you the list of columns in string format with commas. Example: [Jan], [Feb], [Mar], [Apr], [May], [Jun], [Jul], [Aug], [Sept], [Oct], [Nov], [Dec]. If you pass this dynamic query to your pivot, then your pivot columns will display dynamically.
The below SQL script creates the stored procedure which returns pivot table as output.

SQL
CREATE PROCEDURE pivot_TeamVsMatches
AS

/*First get the dynamic columns query*/

DECLARE @columnHeaders NVARCHAR (MAX)
SELECT @columnHeaders  = _
	COALESCE (@columnHeaders  + ',[' + month + ']', '[' + month + ']')
FROM    tbl_Matches
ORDER BY month

DECLARE @FinalQuery NVARCHAR(MAX)

SET @FinalQuery = 	‘SELECT *
			FROM
				(SELECT Team,
					   Month
				FROM tbl_Matches
				) A
			PIVOT
				(
				 COUNT(*)
				 FOR ColName
				 IN (‘+@columnHeaders +’)
				) B
ORDER BY Team’
PRINT ‘Pivot Queuery :’+ @FinalQuery
EXECUTE (@FinalQuery)
GO

This stored procedure returns pivot table as below:

Image 2

Now to get the grand total and row, we need to form the COALESCE query. As shown below…

SQL
/* GRAND TOTAL COLUMN */
DECLARE @GrandTotalCol	NVARCHAR (MAX)
SELECT @GrandTotalCol = COALESCE (@GrandTotalCol + ‘ISNULL _
([' + CAST (Month AS VARCHAR) +'],0) + ', 'ISNULL([' + CAST(Month AS VARCHAR)+ '],0) + ')
FROM	tbl_Matches
GROUP BY Month
ORDER BY  Month
SET @GrandTotalCol = LEFT (@GrandTotalCol, LEN (@GrandTotalCol)-1)

The above query returns as below…

SQL
@GrandTotalCol = ISNULL ([' + CAST (Jan AS VARCHAR) +'],0) + ISNULL _
([' + CAST (Feb AS VARCHAR) +'],0) + ISNULL ([' + CAST (March AS VARCHAR) +'],0) + _
…………. + ISNULL ([' + CAST (Dec AS VARCHAR) +'],0).

/* GRAND TOTAL ROW */
DECLARE @GrandTotalRow	NVARCHAR(MAX)
SELECT @GrandTotalRow = COALESCE(@GrandTotalRow + ',ISNULL(SUM([' + _
CAST(Month AS VARCHAR)+']),0)', 'ISNULL(SUM([' + CAST(Month AS VARCHAR)+']),0)')
FROM	tbl_Matches
GROUP BY Month
ORDER BY  Month

The above query returns as below…

SQL
@GrandTotalRow = ISNULL(SUM([' + CAST(Jan AS VARCHAR)+']),0) + _
ISNULL(SUM([' + CAST(Feb AS VARCHAR)+']),0) + ……… + _
ISNULL(SUM([' + CAST(Dec AS VARCHAR)+']),0).

The above COALESCE strings need to be used in dynamic pivot query…

Below is the stored procedure which will give the total output of our requirement.

SQL
CREATE PROCEDURE pivot_TeamVsMatches
AS
/* COLUMNS HEADERS */
DECLARE @columnHeaders NVARCHAR (MAX)
SELECT @columnHeaders  = COALESCE (@columnHeaders  _
+ ',[' + month + ']', '[' + month + ']')
FROM    tbl_Matches
GROUP BY month
ORDER BY month

/* GRAND TOTAL COLUMN */
DECLARE @GrandTotalCol	NVARCHAR (MAX)
SELECT @GrandTotalCol = COALESCE (@GrandTotalCol + ‘ISNULL ([' + _
CAST (Month AS VARCHAR) +'],0) + ', 'ISNULL([' + CAST(Month AS VARCHAR)+ '],0) + ')
FROM	tbl_Matches
GROUP BY Month
ORDER BY Month
SET @GrandTotalCol = LEFT (@GrandTotalCol, LEN (@GrandTotalCol)-1)

/* GRAND TOTAL ROW */
DECLARE @GrandTotalRow	NVARCHAR(MAX)
SELECT @GrandTotalRow = COALESCE(@GrandTotalRow + ',ISNULL(SUM([' + _
CAST(Month AS VARCHAR)+']),0)', 'ISNULL(SUM([' + CAST(Month AS VARCHAR)+']),0)')
FROM	tbl_Matches
GROUP BY Month
ORDER BY  Month

/* MAIN QUERY */
DECLARE @FinalQuery NVARCHAR (MAX)
SET @FinalQuery = 	‘SELECT *, ('+ @GrandTotalCol + ') _
AS [Grand Total] INTO #temp_MatchesTotal
			FROM
				(SELECT Team,
					   Month
				FROM tbl_Matches
				) A
			PIVOT
				(
				 COUNT (*)
				 FOR ColName
				 IN (‘+@columnHeaders +’)
				) B
ORDER BY Team
SELECT * FROM #temp_MatchesTotal UNION ALL
SELECT ''Grand Total'','''','+@GrandTotalRow +', _
ISNULL (SUM([Grand Total]),0) FROM #temp_MatchesTotal
DROP TABLE #temp_MatchesTotal'
-- PRINT 'Pivot Query '+@FinalQuery
EXECUTE(@PivotQuery)
GO

Result as below…

Image 3

Here in this stored procedure, I have used a temporary table to get the grand total row. I did the UNION ALL with temporary table; don’t forget to drop the temporary table.

For any queries & suggestions, mail me @ narapareddy.shyam@gmail.com. By using some third party controls also we can achieve this, but here I concentrated only on typical/ normal SQL query. If anybody has any efficient and different ways, kindly share with me.

Thanks again. Bye.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) Firstsource Sol Ltd.,
India India
Senior Software Engineer with over 10 years of experience in developing and implementing Internet / Intranet applications using Microsoft .NET technologies (ASP.NET,MVC, C#, MSSQL) and have been involved in the entire software development life cycle for several projects. A quick learner, likes to build creative solutions. Ready to work in a team and individually. Communicative, stress resistant.

Comments and Discussions

 
PraiseGratitude Pin
Member 1484731621-Nov-20 3:25
Member 1484731621-Nov-20 3:25 
QuestionDynamic SQL Pivot Query Pin
Member 1469511419-Dec-19 9:01
Member 1469511419-Dec-19 9:01 
Answerits worked for me just copy past my code on sqlserver (i fixed some problems like not have group by and underline..) Pin
snicee9-Feb-17 19:42
snicee9-Feb-17 19:42 
GeneralRe: its worked for me just copy past my code on sqlserver (i fixed some problems like not have group by and underline..) Pin
Narapareddy Shyamprasad1-Apr-18 21:52
Narapareddy Shyamprasad1-Apr-18 21:52 
GeneralRe: its worked for me just copy past my code on sqlserver (i fixed some problems like not have group by and underline..) Pin
Santosh kumar Pithani12-Sep-18 18:34
professionalSantosh kumar Pithani12-Sep-18 18:34 
GeneralRe: its worked for me just copy past my code on sqlserver (i fixed some problems like not have group by and underline..) Pin
Narapareddy Shyamprasad13-Sep-18 19:45
Narapareddy Shyamprasad13-Sep-18 19:45 
GeneralRe: its worked for me just copy past my code on sqlserver (i fixed some problems like not have group by and underline..) Pin
Santosh kumar Pithani16-Sep-18 20:25
professionalSantosh kumar Pithani16-Sep-18 20:25 
GeneralRe: its worked for me just copy past my code on sqlserver (i fixed some problems like not have group by and underline..) Pin
Narapareddy Shyamprasad16-Sep-18 20:41
Narapareddy Shyamprasad16-Sep-18 20:41 
GeneralRe: its worked for me just copy past my code on sqlserver (i fixed some problems like not have group by and underline..) Pin
Santosh kumar Pithani16-Sep-18 22:37
professionalSantosh kumar Pithani16-Sep-18 22:37 
Suggestionforgot GROUP BY Pin
snicee9-Feb-17 19:40
snicee9-Feb-17 19:40 
QuestionNeed Sum of Row and Column Pin
arpit140525-Aug-15 20:58
arpit140525-Aug-15 20:58 
QuestionSum for Rows and Column Pin
Member 444291618-Jul-15 1:57
Member 444291618-Jul-15 1:57 
QuestionHelp Pin
Narendra Singh Chauhan13-Jul-15 22:24
Narendra Singh Chauhan13-Jul-15 22:24 
Questiontemp table Pin
Member 1136031624-Apr-15 1:05
professionalMember 1136031624-Apr-15 1:05 
QuestionSample DB and SP Pin
jithesh a25-Sep-14 18:49
jithesh a25-Sep-14 18:49 
Generalnice work my +5v Pin
george498626-Jun-14 19:12
professionalgeorge498626-Jun-14 19:12 
hi shyamprasad for sharing this code.
its working code used on my work,below i am providing table structure and querys for people like me who need to test query with table structure

-------table structures------------------

SQL
GO
/****** Object:  Table [dbo].[aa004700T0]    Script Date: 06/27/2014 10:25:47 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[aa004700T0](
	[gender_id] [bigint] NOT NULL,
	[gender_name] [varchar](20) NOT NULL,
 CONSTRAINT [PK_aa004700T0] PRIMARY KEY CLUSTERED 
(
	[gender_id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
INSERT [dbo].[aa004700T0] ([gender_id], [gender_name]) VALUES (1, N'male')
INSERT [dbo].[aa004700T0] ([gender_id], [gender_name]) VALUES (2, N'female')
/****** Object:  Table [dbo].[es007100T0]    Script Date: 06/27/2014 10:25:47 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[es007100T0](
	[diag_detail_id] [bigint] NOT NULL,
	[diag_grp_id] [bigint] NULL,
	[diag_detail_code] [varchar](10) NOT NULL,
	[diag_detail_desc] [varchar](50) NOT NULL,
	[comp_id] [bigint] NOT NULL,
	[ba_id] [bigint] NOT NULL,
	[bl_id] [bigint] NOT NULL,
	[crtd_by] [bigint] NOT NULL,
	[dt_tm] [datetime] NOT NULL,
	[rec_status] [varchar](1) NOT NULL,
	[update_id] [bigint] NOT NULL,
	[update_stat] [varchar](1) NOT NULL,
	[update_seq] [bigint] NOT NULL,
 CONSTRAINT [PK_es007100T0] PRIMARY KEY CLUSTERED 
(
	[diag_detail_id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
INSERT [dbo].[es007100T0] ([diag_detail_id], [diag_grp_id], [diag_detail_code], [diag_detail_desc], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm], [rec_status], [update_id], [update_stat], [update_seq]) VALUES (1, NULL, N'd243', N'Dust Allergy', 5, 4, 1, 1, CAST(0x0000A24000DF5351 AS DateTime), N'A', 1, N'U', 2)
INSERT [dbo].[es007100T0] ([diag_detail_id], [diag_grp_id], [diag_detail_code], [diag_detail_desc], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm], [rec_status], [update_id], [update_stat], [update_seq]) VALUES (2, NULL, N'd244', N'Nuts Allergy', 5, 4, 1, 1, CAST(0x0000A24000DF5351 AS DateTime), N'A', 2, N'U', 2)
INSERT [dbo].[es007100T0] ([diag_detail_id], [diag_grp_id], [diag_detail_code], [diag_detail_desc], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm], [rec_status], [update_id], [update_stat], [update_seq]) VALUES (3, NULL, N'd245', N'Fever', 5, 4, 1, 1, CAST(0x0000A24000DF5351 AS DateTime), N'A', 3, N'U', 2)
INSERT [dbo].[es007100T0] ([diag_detail_id], [diag_grp_id], [diag_detail_code], [diag_detail_desc], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm], [rec_status], [update_id], [update_stat], [update_seq]) VALUES (4, NULL, N'd246', N'Headache', 5, 4, 1, 1, CAST(0x0000A24000DF5351 AS DateTime), N'A', 4, N'U', 2)
INSERT [dbo].[es007100T0] ([diag_detail_id], [diag_grp_id], [diag_detail_code], [diag_detail_desc], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm], [rec_status], [update_id], [update_stat], [update_seq]) VALUES (541134513, NULL, N'D23', N'food allergy', 5, 4, 1, 2, CAST(0x0000A242012BCB41 AS DateTime), N'A', 541134513, N'U', 2)
INSERT [dbo].[es007100T0] ([diag_detail_id], [diag_grp_id], [diag_detail_code], [diag_detail_desc], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm], [rec_status], [update_id], [update_stat], [update_seq]) VALUES (5412637712, NULL, N'DD001', N'Dust Allergy', 5, 4, 1, 2, CAST(0x0000A24700F2742E AS DateTime), N'A', 1, N'U', 3)
INSERT [dbo].[es007100T0] ([diag_detail_id], [diag_grp_id], [diag_detail_code], [diag_detail_desc], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm], [rec_status], [update_id], [update_stat], [update_seq]) VALUES (5412637713, NULL, N'DD002', N'Food Allergy', 5, 4, 1, 2, CAST(0x0000A24700F284E7 AS DateTime), N'A', 541134513, N'U', 3)
INSERT [dbo].[es007100T0] ([diag_detail_id], [diag_grp_id], [diag_detail_code], [diag_detail_desc], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm], [rec_status], [update_id], [update_stat], [update_seq]) VALUES (5412637714, NULL, N'DD003', N'Headache', 5, 4, 1, 2, CAST(0x0000A24700F292C4 AS DateTime), N'A', 4, N'U', 3)
INSERT [dbo].[es007100T0] ([diag_detail_id], [diag_grp_id], [diag_detail_code], [diag_detail_desc], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm], [rec_status], [update_id], [update_stat], [update_seq]) VALUES (5412637715, NULL, N'DD004', N'Nuts Allergy', 5, 4, 1, 2, CAST(0x0000A24700F2A91F AS DateTime), N'A', 2, N'U', 3)
INSERT [dbo].[es007100T0] ([diag_detail_id], [diag_grp_id], [diag_detail_code], [diag_detail_desc], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm], [rec_status], [update_id], [update_stat], [update_seq]) VALUES (5412637716, NULL, N'DD005', N'Fever', 5, 4, 1, 2, CAST(0x0000A24700F2B522 AS DateTime), N'A', 3, N'U', 3)
INSERT [dbo].[es007100T0] ([diag_detail_id], [diag_grp_id], [diag_detail_code], [diag_detail_desc], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm], [rec_status], [update_id], [update_stat], [update_seq]) VALUES (5412637717, NULL, N'DD004', N'Nuts Allergy', 5, 4, 1, 2, CAST(0x0000A2470100D985 AS DateTime), N'I', 2, N'U', 4)
INSERT [dbo].[es007100T0] ([diag_detail_id], [diag_grp_id], [diag_detail_code], [diag_detail_desc], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm], [rec_status], [update_id], [update_stat], [update_seq]) VALUES (5412637718, NULL, N'DD002', N'Food Allergy', 5, 4, 1, 2, CAST(0x0000A247010EB058 AS DateTime), N'I', 541134513, N'U', 4)
INSERT [dbo].[es007100T0] ([diag_detail_id], [diag_grp_id], [diag_detail_code], [diag_detail_desc], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm], [rec_status], [update_id], [update_stat], [update_seq]) VALUES (5412637719, NULL, N'DD002', N'Food Allergy', 5, 4, 1, 2, CAST(0x0000A24A012F8D23 AS DateTime), N'A', 541134513, N'U', 5)
INSERT [dbo].[es007100T0] ([diag_detail_id], [diag_grp_id], [diag_detail_code], [diag_detail_desc], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm], [rec_status], [update_id], [update_stat], [update_seq]) VALUES (5412637720, NULL, N'DD002', N'Food Allergy', 5, 4, 1, 2, CAST(0x0000A24A012F9886 AS DateTime), N'I', 541134513, N'U', 6)
INSERT [dbo].[es007100T0] ([diag_detail_id], [diag_grp_id], [diag_detail_code], [diag_detail_desc], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm], [rec_status], [update_id], [update_stat], [update_seq]) VALUES (5412637721, NULL, N'DD002', N'Food Allergy', 5, 4, 1, 2, CAST(0x0000A24A012FA31C AS DateTime), N'A', 541134513, N'U', 7)
INSERT [dbo].[es007100T0] ([diag_detail_id], [diag_grp_id], [diag_detail_code], [diag_detail_desc], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm], [rec_status], [update_id], [update_stat], [update_seq]) VALUES (5412637722, NULL, N'DD01', N'Cough', 5, 4, 1, 2, CAST(0x0000A24A012FE072 AS DateTime), N'A', 5412637722, N'U', 2)
INSERT [dbo].[es007100T0] ([diag_detail_id], [diag_grp_id], [diag_detail_code], [diag_detail_desc], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm], [rec_status], [update_id], [update_stat], [update_seq]) VALUES (5412637723, NULL, N'DD001', N'Cough', 5, 4, 1, 2, CAST(0x0000A24A012FEDCF AS DateTime), N'A', 5412637722, N'U', 3)
INSERT [dbo].[es007100T0] ([diag_detail_id], [diag_grp_id], [diag_detail_code], [diag_detail_desc], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm], [rec_status], [update_id], [update_stat], [update_seq]) VALUES (5412637724, NULL, N'DD01', N'Cough', 5, 4, 1, 2, CAST(0x0000A24A013017CD AS DateTime), N'A', 5412637722, N'U', 4)
INSERT [dbo].[es007100T0] ([diag_detail_id], [diag_grp_id], [diag_detail_code], [diag_detail_desc], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm], [rec_status], [update_id], [update_stat], [update_seq]) VALUES (5412637725, NULL, N'DD01', N'Food Allergy', 5, 4, 1, 2, CAST(0x0000A24A01302FC9 AS DateTime), N'A', 5412637722, N'U', 5)
INSERT [dbo].[es007100T0] ([diag_detail_id], [diag_grp_id], [diag_detail_code], [diag_detail_desc], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm], [rec_status], [update_id], [update_stat], [update_seq]) VALUES (5412637726, NULL, N'DD01', N'Cough', 5, 4, 1, 2, CAST(0x0000A24A01303C25 AS DateTime), N'A', 5412637722, N'U', 6)
INSERT [dbo].[es007100T0] ([diag_detail_id], [diag_grp_id], [diag_detail_code], [diag_detail_desc], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm], [rec_status], [update_id], [update_stat], [update_seq]) VALUES (5412637727, NULL, N'DD01', N'Coughs', 5, 4, 1, 2, CAST(0x0000A24A01305F43 AS DateTime), N'A', 5412637722, N'U', 7)
INSERT [dbo].[es007100T0] ([diag_detail_id], [diag_grp_id], [diag_detail_code], [diag_detail_desc], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm], [rec_status], [update_id], [update_stat], [update_seq]) VALUES (5412637728, NULL, N'DD01', N'Cough', 5, 4, 1, 2, CAST(0x0000A24A01306563 AS DateTime), N'A', 5412637722, N'U', 8)
INSERT [dbo].[es007100T0] ([diag_detail_id], [diag_grp_id], [diag_detail_code], [diag_detail_desc], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm], [rec_status], [update_id], [update_stat], [update_seq]) VALUES (5412637729, NULL, N'DD01', N'Cough', 5, 4, 1, 2, CAST(0x0000A24A0130DB3F AS DateTime), N'I', 5412637722, N'U', 9)
INSERT [dbo].[es007100T0] ([diag_detail_id], [diag_grp_id], [diag_detail_code], [diag_detail_desc], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm], [rec_status], [update_id], [update_stat], [update_seq]) VALUES (5412637730, NULL, N'DD01', N'Cough', 5, 4, 1, 2, CAST(0x0000A24A0130E4F8 AS DateTime), N'A', 5412637722, N'U', 10)
INSERT [dbo].[es007100T0] ([diag_detail_id], [diag_grp_id], [diag_detail_code], [diag_detail_desc], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm], [rec_status], [update_id], [update_stat], [update_seq]) VALUES (5412637731, NULL, N'DD01', N'Coughs', 5, 4, 1, 2, CAST(0x0000A24A01328816 AS DateTime), N'A', 5412637722, N'U', 11)
INSERT [dbo].[es007100T0] ([diag_detail_id], [diag_grp_id], [diag_detail_code], [diag_detail_desc], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm], [rec_status], [update_id], [update_stat], [update_seq]) VALUES (5412637732, NULL, N'DD01', N'Cough', 5, 4, 1, 2, CAST(0x0000A24A01328E60 AS DateTime), N'A', 5412637722, N'U', 12)
INSERT [dbo].[es007100T0] ([diag_detail_id], [diag_grp_id], [diag_detail_code], [diag_detail_desc], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm], [rec_status], [update_id], [update_stat], [update_seq]) VALUES (5412637733, NULL, N'DD01', N'Cough', 5, 4, 1, 2, CAST(0x0000A24A013298A2 AS DateTime), N'I', 5412637722, N'U', 13)
INSERT [dbo].[es007100T0] ([diag_detail_id], [diag_grp_id], [diag_detail_code], [diag_detail_desc], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm], [rec_status], [update_id], [update_stat], [update_seq]) VALUES (5412637734, NULL, N'DD01', N'Cough', 5, 4, 1, 2, CAST(0x0000A24A0132A244 AS DateTime), N'A', 5412637722, N'U', 14)
INSERT [dbo].[es007100T0] ([diag_detail_id], [diag_grp_id], [diag_detail_code], [diag_detail_desc], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm], [rec_status], [update_id], [update_stat], [update_seq]) VALUES (5412637735, NULL, N'D006', N'Pneumonia', 5, 4, 1, 2, CAST(0x0000A24E00CC8130 AS DateTime), N'A', 5412637735, N'U', 2)
INSERT [dbo].[es007100T0] ([diag_detail_id], [diag_grp_id], [diag_detail_code], [diag_detail_desc], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm], [rec_status], [update_id], [update_stat], [update_seq]) VALUES (5412637738, NULL, N'DD007', N'Head Ache', 5, 4, 1, 2, CAST(0x0000A29301027639 AS DateTime), N'A', 5412637738, N'U', 2)
INSERT [dbo].[es007100T0] ([diag_detail_id], [diag_grp_id], [diag_detail_code], [diag_detail_desc], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm], [rec_status], [update_id], [update_stat], [update_seq]) VALUES (5412637739, NULL, N'DD007', N'Migrane', 5, 4, 1, 2, CAST(0x0000A2930102C866 AS DateTime), N'A', 5412637738, N'U', 3)
INSERT [dbo].[es007100T0] ([diag_detail_id], [diag_grp_id], [diag_detail_code], [diag_detail_desc], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm], [rec_status], [update_id], [update_stat], [update_seq]) VALUES (5412637740, 541265555, N'DD001', N'Dust Allergy', 5, 4, 1, 2, CAST(0x0000A2F500ACDDF5 AS DateTime), N'A', 1, N'A', 1)
INSERT [dbo].[es007100T0] ([diag_detail_id], [diag_grp_id], [diag_detail_code], [diag_detail_desc], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm], [rec_status], [update_id], [update_stat], [update_seq]) VALUES (5412637741, 541265555, N'DD002', N'Food Allergy', 5, 4, 1, 2, CAST(0x0000A2F500AD0D40 AS DateTime), N'A', 541134513, N'A', 1)
INSERT [dbo].[es007100T0] ([diag_detail_id], [diag_grp_id], [diag_detail_code], [diag_detail_desc], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm], [rec_status], [update_id], [update_stat], [update_seq]) VALUES (5412637742, 541265556, N'DD003', N'Headache', 5, 4, 1, 2, CAST(0x0000A2F500AD15DC AS DateTime), N'A', 4, N'A', 1)
INSERT [dbo].[es007100T0] ([diag_detail_id], [diag_grp_id], [diag_detail_code], [diag_detail_desc], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm], [rec_status], [update_id], [update_stat], [update_seq]) VALUES (5412637743, 541265555, N'DD004', N'Nuts Allergy', 5, 4, 1, 2, CAST(0x0000A2F500AD1F62 AS DateTime), N'I', 2, N'A', 1)
INSERT [dbo].[es007100T0] ([diag_detail_id], [diag_grp_id], [diag_detail_code], [diag_detail_desc], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm], [rec_status], [update_id], [update_stat], [update_seq]) VALUES (5412637744, 541265552, N'D006', N'Pneumonia', 5, 4, 1, 2, CAST(0x0000A2F500AD41D1 AS DateTime), N'A', 5412637735, N'A', 1)
INSERT [dbo].[es007100T0] ([diag_detail_id], [diag_grp_id], [diag_detail_code], [diag_detail_desc], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm], [rec_status], [update_id], [update_stat], [update_seq]) VALUES (5412637745, 541265553, N'DD005', N'Fever', 5, 4, 1, 2, CAST(0x0000A2F500AD4A3C AS DateTime), N'A', 3, N'A', 1)
INSERT [dbo].[es007100T0] ([diag_detail_id], [diag_grp_id], [diag_detail_code], [diag_detail_desc], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm], [rec_status], [update_id], [update_stat], [update_seq]) VALUES (5412637746, 541265556, N'DD007', N'Migrane', 5, 4, 1, 2, CAST(0x0000A2F500AD5F0F AS DateTime), N'A', 5412637738, N'A', 1)
INSERT [dbo].[es007100T0] ([diag_detail_id], [diag_grp_id], [diag_detail_code], [diag_detail_desc], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm], [rec_status], [update_id], [update_stat], [update_seq]) VALUES (5412637747, 541265552, N'DD01', N'Cough', 5, 4, 1, 2, CAST(0x0000A2F500AD6A93 AS DateTime), N'A', 5412637722, N'A', 1)
INSERT [dbo].[es007100T0] ([diag_detail_id], [diag_grp_id], [diag_detail_code], [diag_detail_desc], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm], [rec_status], [update_id], [update_stat], [update_seq]) VALUES (5412637748, 541265551, N'A1002', N'Head Injury', 5, 4, 1, 2, CAST(0x0000A2F5011CBEC9 AS DateTime), N'A', 5412637748, N'A', 1)
INSERT [dbo].[es007100T0] ([diag_detail_id], [diag_grp_id], [diag_detail_code], [diag_detail_desc], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm], [rec_status], [update_id], [update_stat], [update_seq]) VALUES (5412637749, 541265551, N'B1003', N'Bone Injury', 5, 4, 1, 2, CAST(0x0000A2F5011D1CBB AS DateTime), N'A', 5412637749, N'A', 1)
INSERT [dbo].[es007100T0] ([diag_detail_id], [diag_grp_id], [diag_detail_code], [diag_detail_desc], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm], [rec_status], [update_id], [update_stat], [update_seq]) VALUES (5412637750, 541265551, N'B1004', N'Bleeding', 5, 4, 1, 2, CAST(0x0000A2F5011D71BD AS DateTime), N'A', 5412637750, N'A', 1)
INSERT [dbo].[es007100T0] ([diag_detail_id], [diag_grp_id], [diag_detail_code], [diag_detail_desc], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm], [rec_status], [update_id], [update_stat], [update_seq]) VALUES (5412637751, 541265551, N'F1002', N'Fracture', 5, 4, 1, 2, CAST(0x0000A2F5011DD09A AS DateTime), N'A', 5412637751, N'A', 1)
INSERT [dbo].[es007100T0] ([diag_detail_id], [diag_grp_id], [diag_detail_code], [diag_detail_desc], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm], [rec_status], [update_id], [update_stat], [update_seq]) VALUES (5412637752, 541265557, N'DH1002', N'Vomiting', 5, 4, 1, 2, CAST(0x0000A2F800AD42A2 AS DateTime), N'A', 5412637752, N'A', 1)
INSERT [dbo].[es007100T0] ([diag_detail_id], [diag_grp_id], [diag_detail_code], [diag_detail_desc], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm], [rec_status], [update_id], [update_stat], [update_seq]) VALUES (5412637753, 541265551, N'GH3003', N'Headache', 5, 4, 1, 2, CAST(0x0000A2F800AD7756 AS DateTime), N'A', 5412637753, N'A', 1)
INSERT [dbo].[es007100T0] ([diag_detail_id], [diag_grp_id], [diag_detail_code], [diag_detail_desc], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm], [rec_status], [update_id], [update_stat], [update_seq]) VALUES (5412637754, 541265557, N'CH2002', N'Chest Pain', 5, 4, 1, 2, CAST(0x0000A2F800ADF3AF AS DateTime), N'A', 5412637754, N'A', 1)
INSERT [dbo].[es007100T0] ([diag_detail_id], [diag_grp_id], [diag_detail_code], [diag_detail_desc], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm], [rec_status], [update_id], [update_stat], [update_seq]) VALUES (5412637755, 541265557, N'DH1004', N'Dehydration', 5, 4, 1, 2, CAST(0x0000A2F800AE3219 AS DateTime), N'A', 5412637755, N'A', 1)
INSERT [dbo].[es007100T0] ([diag_detail_id], [diag_grp_id], [diag_detail_code], [diag_detail_desc], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm], [rec_status], [update_id], [update_stat], [update_seq]) VALUES (5412637756, 5412655512, N'DD008', N'Hypertension', 5, 4, 1, 2, CAST(0x0000A2FA00AE3A4B AS DateTime), N'A', 5412637756, N'A', 1)
INSERT [dbo].[es007100T0] ([diag_detail_id], [diag_grp_id], [diag_detail_code], [diag_detail_desc], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm], [rec_status], [update_id], [update_stat], [update_seq]) VALUES (5412637757, 5412655513, N'DD009', N'Mental Disorder', 5, 4, 1, 2, CAST(0x0000A2FA00AE53E3 AS DateTime), N'A', 5412637757, N'A', 1)
INSERT [dbo].[es007100T0] ([diag_detail_id], [diag_grp_id], [diag_detail_code], [diag_detail_desc], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm], [rec_status], [update_id], [update_stat], [update_seq]) VALUES (5412637758, 5412655514, N'DD010', N'Stroke', 5, 4, 1, 2, CAST(0x0000A2FA00AE699B AS DateTime), N'A', 5412637758, N'A', 1)
INSERT [dbo].[es007100T0] ([diag_detail_id], [diag_grp_id], [diag_detail_code], [diag_detail_desc], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm], [rec_status], [update_id], [update_stat], [update_seq]) VALUES (5412637759, 5412655515, N'DD011', N'Tuberculosis', 5, 4, 1, 2, CAST(0x0000A2FA00AE7AA9 AS DateTime), N'A', 5412637759, N'A', 1)
INSERT [dbo].[es007100T0] ([diag_detail_id], [diag_grp_id], [diag_detail_code], [diag_detail_desc], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm], [rec_status], [update_id], [update_stat], [update_seq]) VALUES (5412637760, 5412655511, N'DD012', N'Diabates', 5, 4, 1, 2, CAST(0x0000A2FA00AE8E01 AS DateTime), N'A', 5412637760, N'A', 1)
INSERT [dbo].[es007100T0] ([diag_detail_id], [diag_grp_id], [diag_detail_code], [diag_detail_desc], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm], [rec_status], [update_id], [update_stat], [update_seq]) VALUES (5412637761, 541265552, N'D00071', N'Body Pain', 5, 4, 1, 2, CAST(0x0000A3560125CF26 AS DateTime), N'A', 5412637761, N'A', 1)
/****** Object:  Table [dbo].[es100201T0]    Script Date: 06/27/2014 10:25:47 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[es100201T0](
	[diag_case_id] [bigint] NOT NULL,
	[diag_case] [varchar](50) NOT NULL,
	[diag_case_flag] [varchar](1) NOT NULL,
 CONSTRAINT [PK_es100201T0] PRIMARY KEY CLUSTERED 
(
	[diag_case_id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
INSERT [dbo].[es100201T0] ([diag_case_id], [diag_case], [diag_case_flag]) VALUES (1, N'Infectious Disease', N'I')
INSERT [dbo].[es100201T0] ([diag_case_id], [diag_case], [diag_case_flag]) VALUES (2, N'Non Infectious Disease', N'N')
INSERT [dbo].[es100201T0] ([diag_case_id], [diag_case], [diag_case_flag]) VALUES (3, N'First Aid Cases', N'F')
INSERT [dbo].[es100201T0] ([diag_case_id], [diag_case], [diag_case_flag]) VALUES (4, N'Family History', N'H')
/****** Object:  Table [dbo].[es100200T0]    Script Date: 06/27/2014 10:25:47 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[es100200T0](
	[diag_grp_id] [bigint] NOT NULL,
	[diag_case_id] [bigint] NOT NULL,
	[diag_grp_code] [varchar](20) NOT NULL,
	[diag_grp_name] [varchar](50) NOT NULL,
	[rec_status] [varchar](1) NOT NULL,
	[update_id] [bigint] NOT NULL,
	[update_stat] [varchar](1) NOT NULL,
	[update_seq] [bigint] NOT NULL,
	[comp_id] [bigint] NOT NULL,
	[ba_id] [bigint] NOT NULL,
	[bl_id] [bigint] NOT NULL,
	[crtd_by] [bigint] NOT NULL,
	[dt_tm] [datetime] NOT NULL,
 CONSTRAINT [PK_es100200T0] PRIMARY KEY CLUSTERED 
(
	[diag_grp_id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY],
 CONSTRAINT [IX_es100200T0] UNIQUE NONCLUSTERED 
(
	[diag_grp_code] ASC,
	[update_seq] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY],
 CONSTRAINT [IX_es100200T0_1] UNIQUE NONCLUSTERED 
(
	[diag_grp_name] ASC,
	[update_seq] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
INSERT [dbo].[es100200T0] ([diag_grp_id], [diag_case_id], [diag_grp_code], [diag_grp_name], [rec_status], [update_id], [update_stat], [update_seq], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm]) VALUES (541265551, 3, N'A1001', N'Accident', N'A', 541265551, N'A', 1, 5, 4, 1, 2, CAST(0x0000A2F40119F2B6 AS DateTime))
INSERT [dbo].[es100200T0] ([diag_grp_id], [diag_case_id], [diag_grp_code], [diag_grp_name], [rec_status], [update_id], [update_stat], [update_seq], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm]) VALUES (541265552, 1, N'V1002', N'Chiken Guniya', N'A', 541265552, N'U', 2, 5, 4, 1, 2, CAST(0x0000A2F4011CD509 AS DateTime))
INSERT [dbo].[es100200T0] ([diag_grp_id], [diag_case_id], [diag_grp_code], [diag_grp_name], [rec_status], [update_id], [update_stat], [update_seq], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm]) VALUES (541265553, 1, N'C1003', N'Chiken Pox', N'A', 541265553, N'A', 1, 5, 4, 1, 2, CAST(0x0000A2F4011D0B63 AS DateTime))
INSERT [dbo].[es100200T0] ([diag_grp_id], [diag_case_id], [diag_grp_code], [diag_grp_name], [rec_status], [update_id], [update_stat], [update_seq], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm]) VALUES (541265554, 2, N'C1004', N'Cancer', N'A', 541265554, N'A', 1, 5, 4, 1, 2, CAST(0x0000A2F4011D3B85 AS DateTime))
INSERT [dbo].[es100200T0] ([diag_grp_id], [diag_case_id], [diag_grp_code], [diag_grp_name], [rec_status], [update_id], [update_stat], [update_seq], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm]) VALUES (541265555, 3, N'A1002', N'Allergy', N'A', 541265555, N'A', 1, 5, 4, 1, 2, CAST(0x0000A2F4011D96D6 AS DateTime))
INSERT [dbo].[es100200T0] ([diag_grp_id], [diag_case_id], [diag_grp_code], [diag_grp_name], [rec_status], [update_id], [update_stat], [update_seq], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm]) VALUES (541265556, 2, N'M1001', N'Migrane', N'A', 541265556, N'A', 1, 5, 4, 1, 2, CAST(0x0000A2F4011DCA39 AS DateTime))
INSERT [dbo].[es100200T0] ([diag_grp_id], [diag_case_id], [diag_grp_code], [diag_grp_name], [rec_status], [update_id], [update_stat], [update_seq], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm]) VALUES (541265557, 2, N'F1001', N'Fix', N'A', 541265557, N'U', 2, 5, 4, 1, 2, CAST(0x0000A2F4011DDC78 AS DateTime))
INSERT [dbo].[es100200T0] ([diag_grp_id], [diag_case_id], [diag_grp_code], [diag_grp_name], [rec_status], [update_id], [update_stat], [update_seq], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm]) VALUES (541265558, 3, N'F1001', N'Fix', N'I', 541265557, N'A', 1, 5, 4, 1, 2, CAST(0x0000A2F5011344DB AS DateTime))
INSERT [dbo].[es100200T0] ([diag_grp_id], [diag_case_id], [diag_grp_code], [diag_grp_name], [rec_status], [update_id], [update_stat], [update_seq], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm]) VALUES (541265559, 1, N'V1002', N'Chiken Guniya', N'I', 541265552, N'U', 3, 5, 4, 1, 2, CAST(0x0000A2F5011A9EE8 AS DateTime))
INSERT [dbo].[es100200T0] ([diag_grp_id], [diag_case_id], [diag_grp_code], [diag_grp_name], [rec_status], [update_id], [update_stat], [update_seq], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm]) VALUES (5412655511, 4, N'DG001', N'Diabates', N'A', 5412655511, N'A', 1, 5, 4, 1, 2, CAST(0x0000A2FA00ADAABF AS DateTime))
INSERT [dbo].[es100200T0] ([diag_grp_id], [diag_case_id], [diag_grp_code], [diag_grp_name], [rec_status], [update_id], [update_stat], [update_seq], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm]) VALUES (5412655512, 4, N'DG002', N'Hypertension', N'A', 5412655512, N'A', 1, 5, 4, 1, 2, CAST(0x0000A2FA00ADC331 AS DateTime))
INSERT [dbo].[es100200T0] ([diag_grp_id], [diag_case_id], [diag_grp_code], [diag_grp_name], [rec_status], [update_id], [update_stat], [update_seq], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm]) VALUES (5412655513, 4, N'DG003', N'Mental Disorder', N'A', 5412655513, N'A', 1, 5, 4, 1, 2, CAST(0x0000A2FA00ADDA39 AS DateTime))
INSERT [dbo].[es100200T0] ([diag_grp_id], [diag_case_id], [diag_grp_code], [diag_grp_name], [rec_status], [update_id], [update_stat], [update_seq], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm]) VALUES (5412655514, 4, N'DG004', N'Stroke', N'A', 5412655514, N'A', 1, 5, 4, 1, 2, CAST(0x0000A2FA00ADEEE7 AS DateTime))
INSERT [dbo].[es100200T0] ([diag_grp_id], [diag_case_id], [diag_grp_code], [diag_grp_name], [rec_status], [update_id], [update_stat], [update_seq], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm]) VALUES (5412655515, 4, N'DG005', N'Tuberculosis', N'A', 5412655515, N'A', 1, 5, 4, 1, 2, CAST(0x0000A2FA00AE0DD0 AS DateTime))
INSERT [dbo].[es100200T0] ([diag_grp_id], [diag_case_id], [diag_grp_code], [diag_grp_name], [rec_status], [update_id], [update_stat], [update_seq], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm]) VALUES (5412655516, 1, N'V1002', N'Chiken Guniya', N'A', 541265552, N'U', 4, 5, 4, 1, 2, CAST(0x0000A35400D99D58 AS DateTime))
INSERT [dbo].[es100200T0] ([diag_grp_id], [diag_case_id], [diag_grp_code], [diag_grp_name], [rec_status], [update_id], [update_stat], [update_seq], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm]) VALUES (5412655517, 1, N'V1002', N'Chiken Guniya', N'I', 541265552, N'U', 5, 5, 4, 1, 2, CAST(0x0000A35400E580D2 AS DateTime))
INSERT [dbo].[es100200T0] ([diag_grp_id], [diag_case_id], [diag_grp_code], [diag_grp_name], [rec_status], [update_id], [update_stat], [update_seq], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm]) VALUES (5412655518, 1, N'V1002', N'Chiken Guniya', N'A', 541265552, N'A', 1, 5, 4, 1, 2, CAST(0x0000A35600BDB851 AS DateTime))
/****** Object:  Table [dbo].[es009000T0]    Script Date: 06/27/2014 10:25:47 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[es009000T0](
	[student_id] [bigint] NOT NULL,
	[salutation_id] [bigint] NULL,
	[applicant_id] [bigint] NULL,
	[application_no] [varchar](15) NULL,
	[student_no] [varchar](50) NOT NULL,
	[moe_no] [varchar](15) NULL,
	[applied_course_id] [bigint] NULL,
	[acyear_id] [bigint] NULL,
	[stud_doj] [datetime] NULL,
	[fee_com_subgrp_id] [bigint] NULL,
	[apld_date] [datetime] NULL,
	[ministry_list_stat] [varchar](1) NULL,
	[house_id] [bigint] NULL,
	[stud_code] [varchar](20) NOT NULL,
	[stud_fname] [varchar](20) NOT NULL,
	[stud_mname] [varchar](20) NULL,
	[stud_sname] [varchar](20) NULL,
	[pasprt_fname] [varchar](20) NULL,
	[fname_native] [varchar](20) NULL,
	[mname_native] [varchar](20) NULL,
	[sname_native] [varchar](20) NULL,
	[emrgncy_cntct_name] [varchar](20) NULL,
	[emrgncy_cntct_phno] [varchar](20) NULL,
	[nationality_id] [bigint] NULL,
	[born_place] [varchar](20) NULL,
	[born_country_id] [bigint] NULL,
	[parent_emp_flag] [varchar](1) NULL,
	[cat_req_flag] [varchar](1) NULL,
	[hostel_req] [varchar](1) NULL,
	[accomodation_type_id] [bigint] NULL,
	[aftr_care_req_flag] [varchar](1) NULL,
	[gender_id] [bigint] NULL,
	[religion_id] [bigint] NULL,
	[cast_id] [bigint] NULL,
	[mother_tng_id] [bigint] NULL,
	[stud_interests] [varchar](50) NULL,
	[sponsor_id] [bigint] NULL,
	[ethnicity_id] [bigint] NULL,
	[remarks] [varchar](50) NULL,
	[transport_req_flag] [varchar](1) NULL,
	[primary_cntct_flag] [varchar](1) NULL,
	[upld_date_file_name] [varchar](70) NULL,
	[upld_org_file_name] [varchar](50) NULL,
	[upld_file_extn] [varchar](20) NULL,
	[stud_dob] [datetime] NULL,
	[comp_id] [bigint] NULL,
	[ba_id] [bigint] NULL,
	[bl_id] [bigint] NULL,
	[rec_status] [varchar](1) NULL,
	[update_stat] [varchar](1) NULL,
	[update_id] [bigint] NULL,
	[update_seq] [bigint] NULL,
	[crtd_by] [bigint] NULL,
	[course_section_alloc_id] [bigint] NULL,
	[dt_tm] [datetime] NULL,
	[flag] [varchar](1) NULL,
 CONSTRAINT [PK_es009000T0] PRIMARY KEY CLUSTERED 
(
	[student_id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
INSERT [dbo].[es009000T0] ([student_id], [salutation_id], [applicant_id], [application_no], [student_no], [moe_no], [applied_course_id], [acyear_id], [stud_doj], [fee_com_subgrp_id], [apld_date], [ministry_list_stat], [house_id], [stud_code], [stud_fname], [stud_mname], [stud_sname], [pasprt_fname], [fname_native], [mname_native], [sname_native], [emrgncy_cntct_name], [emrgncy_cntct_phno], [nationality_id], [born_place], [born_country_id], [parent_emp_flag], [cat_req_flag], [hostel_req], [accomodation_type_id], [aftr_care_req_flag], [gender_id], [religion_id], [cast_id], [mother_tng_id], [stud_interests], [sponsor_id], [ethnicity_id], [remarks], [transport_req_flag], [primary_cntct_flag], [upld_date_file_name], [upld_org_file_name], [upld_file_extn], [stud_dob], [comp_id], [ba_id], [bl_id], [rec_status], [update_stat], [update_id], [update_seq], [crtd_by], [course_section_alloc_id], [dt_tm], [flag]) VALUES (54126370450, 3, 54126314241, N'AN-140531-1', N'5-4-1-25-1-4126370450', NULL, 541128134, 541262832, CAST(0x0000A33C00000000 AS DateTime), 541129942, NULL, NULL, NULL, N'AC-140531-', N'Rahul', N'Manu', NULL, NULL, N'Rahul', N'Manu', NULL, NULL, NULL, 54112491, NULL, 10, N'I', N'I', N'I', NULL, N'I', 1, 1, 3, 1, NULL, NULL, 541125139, N'Good', N'A', N'1', N'31052014101537imagesCAAUX9KD.jpg', N'imagesCAAUX9KD.jpg', N'jpg', CAST(0x00009EF400000000 AS DateTime), 5, 4, 1, N'A', N'A', 54126370450, 1, 2, 5412641115, CAST(0x0000A33C00A95510 AS DateTime), NULL)
INSERT [dbo].[es009000T0] ([student_id], [salutation_id], [applicant_id], [application_no], [student_no], [moe_no], [applied_course_id], [acyear_id], [stud_doj], [fee_com_subgrp_id], [apld_date], [ministry_list_stat], [house_id], [stud_code], [stud_fname], [stud_mname], [stud_sname], [pasprt_fname], [fname_native], [mname_native], [sname_native], [emrgncy_cntct_name], [emrgncy_cntct_phno], [nationality_id], [born_place], [born_country_id], [parent_emp_flag], [cat_req_flag], [hostel_req], [accomodation_type_id], [aftr_care_req_flag], [gender_id], [religion_id], [cast_id], [mother_tng_id], [stud_interests], [sponsor_id], [ethnicity_id], [remarks], [transport_req_flag], [primary_cntct_flag], [upld_date_file_name], [upld_org_file_name], [upld_file_extn], [stud_dob], [comp_id], [ba_id], [bl_id], [rec_status], [update_stat], [update_id], [update_seq], [crtd_by], [course_section_alloc_id], [dt_tm], [flag]) VALUES (54126370451, 3, 54126314242, N'AN-140531-2', N'5-4-1-25-1-4126370451', NULL, 541128133, 541128325, CAST(0x0000A33C00000000 AS DateTime), 541129942, NULL, NULL, 541263747, N'AC-140531-', N'Manu', N'M', NULL, NULL, N'Manu', N'M', NULL, NULL, NULL, 54112491, NULL, 10, N'I', N'I', N'I', NULL, N'I', 1, 1, 3, 1, NULL, NULL, 541125139, NULL, N'I', N'1', N'31052014101537mirfan00.jpg', N'mirfan00.jpg', N'jpg', CAST(0x00009EF400000000 AS DateTime), 5, 4, 1, N'A', N'U', 54126370451, 2, 2, 5412641112, CAST(0x0000A33C00A9866C AS DateTime), NULL)
INSERT [dbo].[es009000T0] ([student_id], [salutation_id], [applicant_id], [application_no], [student_no], [moe_no], [applied_course_id], [acyear_id], [stud_doj], [fee_com_subgrp_id], [apld_date], [ministry_list_stat], [house_id], [stud_code], [stud_fname], [stud_mname], [stud_sname], [pasprt_fname], [fname_native], [mname_native], [sname_native], [emrgncy_cntct_name], [emrgncy_cntct_phno], [nationality_id], [born_place], [born_country_id], [parent_emp_flag], [cat_req_flag], [hostel_req], [accomodation_type_id], [aftr_care_req_flag], [gender_id], [religion_id], [cast_id], [mother_tng_id], [stud_interests], [sponsor_id], [ethnicity_id], [remarks], [transport_req_flag], [primary_cntct_flag], [upld_date_file_name], [upld_org_file_name], [upld_file_extn], [stud_dob], [comp_id], [ba_id], [bl_id], [rec_status], [update_stat], [update_id], [update_seq], [crtd_by], [course_section_alloc_id], [dt_tm], [flag]) VALUES (54126370452, 3, 54126314243, N'AN-140531-3', N'5-4-1-25-1-4126370452', NULL, 541128133, 541128325, CAST(0x0000A33C00000000 AS DateTime), 541129942, NULL, NULL, 541263747, N'AC-140531-', N'David', NULL, N'Abraham', NULL, N'David', NULL, N'Abraham', NULL, NULL, 54112491, NULL, 10, N'I', N'I', N'A', NULL, N'I', 1, 3, 6, 1, NULL, NULL, 541125139, NULL, N'I', N'1', N'31052014105141Koala.jpg', N'Koala.jpg', N'jpg', CAST(0x00009EF400000000 AS DateTime), 5, 4, 1, N'A', N'U', 54126370452, 2, 2, 5412641111, CAST(0x0000A33C00B32818 AS DateTime), NULL)
INSERT [dbo].[es009000T0] ([student_id], [salutation_id], [applicant_id], [application_no], [student_no], [moe_no], [applied_course_id], [acyear_id], [stud_doj], [fee_com_subgrp_id], [apld_date], [ministry_list_stat], [house_id], [stud_code], [stud_fname], [stud_mname], [stud_sname], [pasprt_fname], [fname_native], [mname_native], [sname_native], [emrgncy_cntct_name], [emrgncy_cntct_phno], [nationality_id], [born_place], [born_country_id], [parent_emp_flag], [cat_req_flag], [hostel_req], [accomodation_type_id], [aftr_care_req_flag], [gender_id], [religion_id], [cast_id], [mother_tng_id], [stud_interests], [sponsor_id], [ethnicity_id], [remarks], [transport_req_flag], [primary_cntct_flag], [upld_date_file_name], [upld_org_file_name], [upld_file_extn], [stud_dob], [comp_id], [ba_id], [bl_id], [rec_status], [update_stat], [update_id], [update_seq], [crtd_by], [course_section_alloc_id], [dt_tm], [flag]) VALUES (54126370453, 3, 54126314243, N'AN-140531-3', N'5-4-1-25-1-4126370452', NULL, 541128133, 541128325, CAST(0x0000A33C00000000 AS DateTime), 541129942, NULL, NULL, 541263747, N'AC-140531-', N'David', NULL, N'Abraham', NULL, N'David', NULL, N'Abraham', NULL, NULL, 54112491, NULL, 10, N'I', N'I', N'A', NULL, N'I', 1, 3, 6, 1, NULL, NULL, 541125139, NULL, N'I', N'1', N'31052014105141Koala.jpg', N'Koala.jpg', N'jpg', CAST(0x00009EF400000000 AS DateTime), 5, 4, 1, N'A', N'U', 54126370452, 3, 2, 5412641111, CAST(0x0000A33C0115A4B5 AS DateTime), N'W')
INSERT [dbo].[es009000T0] ([student_id], [salutation_id], [applicant_id], [application_no], [student_no], [moe_no], [applied_course_id], [acyear_id], [stud_doj], [fee_com_subgrp_id], [apld_date], [ministry_list_stat], [house_id], [stud_code], [stud_fname], [stud_mname], [stud_sname], [pasprt_fname], [fname_native], [mname_native], [sname_native], [emrgncy_cntct_name], [emrgncy_cntct_phno], [nationality_id], [born_place], [born_country_id], [parent_emp_flag], [cat_req_flag], [hostel_req], [accomodation_type_id], [aftr_care_req_flag], [gender_id], [religion_id], [cast_id], [mother_tng_id], [stud_interests], [sponsor_id], [ethnicity_id], [remarks], [transport_req_flag], [primary_cntct_flag], [upld_date_file_name], [upld_org_file_name], [upld_file_extn], [stud_dob], [comp_id], [ba_id], [bl_id], [rec_status], [update_stat], [update_id], [update_seq], [crtd_by], [course_section_alloc_id], [dt_tm], [flag]) VALUES (54126370454, 3, 54126314244, N'AN-140602-1', N'5-4-1-25-1-4126370454', NULL, 541128134, 541128325, CAST(0x0000A35500000000 AS DateTime), 541129942, NULL, NULL, 541263747, N'AC-140602-', N'John', NULL, N'Abraham', NULL, N'John', NULL, N'Abraham', NULL, NULL, 54112491, NULL, 10, N'A', N'I', N'I', NULL, N'I', 1, 3, 2, 1, NULL, 5412639389, 541125139, NULL, N'I', N'1', N'622014122416PMMy_Passport_size_Single_Photo.jpg', N'My_Passport_size_Single_Photo.jpg', N'jpg', CAST(0x0000995400000000 AS DateTime), 5, 4, 1, N'A', N'U', 54126370454, 4, 2, 5412641115, CAST(0x0000A33E00CCD6D4 AS DateTime), NULL)
INSERT [dbo].[es009000T0] ([student_id], [salutation_id], [applicant_id], [application_no], [student_no], [moe_no], [applied_course_id], [acyear_id], [stud_doj], [fee_com_subgrp_id], [apld_date], [ministry_list_stat], [house_id], [stud_code], [stud_fname], [stud_mname], [stud_sname], [pasprt_fname], [fname_native], [mname_native], [sname_native], [emrgncy_cntct_name], [emrgncy_cntct_phno], [nationality_id], [born_place], [born_country_id], [parent_emp_flag], [cat_req_flag], [hostel_req], [accomodation_type_id], [aftr_care_req_flag], [gender_id], [religion_id], [cast_id], [mother_tng_id], [stud_interests], [sponsor_id], [ethnicity_id], [remarks], [transport_req_flag], [primary_cntct_flag], [upld_date_file_name], [upld_org_file_name], [upld_file_extn], [stud_dob], [comp_id], [ba_id], [bl_id], [rec_status], [update_stat], [update_id], [update_seq], [crtd_by], [course_section_alloc_id], [dt_tm], [flag]) VALUES (54126370455, 3, 54126314244, N'AN-140602-1', N'5-4-1-25-1-4126370454', NULL, 541128134, 541128325, CAST(0x0000A35500000000 AS DateTime), 541129942, NULL, NULL, 541263747, N'AC-140602-', N'John', NULL, N'Abraham', NULL, N'John', NULL, N'Abraham', NULL, NULL, 54112491, NULL, 10, N'A', N'I', N'I', NULL, N'I', 1, 3, 2, 1, NULL, 5412639389, 541125139, NULL, N'I', N'1', N'622014122416PMMy_Passport_size_Single_Photo.jpg', N'My_Passport_size_Single_Photo.jpg', N'jpg', CAST(0x0000995400000000 AS DateTime), 5, 4, 1, N'A', N'U', 54126370454, 4, 2, 5412641115, CAST(0x0000A33E00CCF86E AS DateTime), N'W')
INSERT [dbo].[es009000T0] ([student_id], [salutation_id], [applicant_id], [application_no], [student_no], [moe_no], [applied_course_id], [acyear_id], [stud_doj], [fee_com_subgrp_id], [apld_date], [ministry_list_stat], [house_id], [stud_code], [stud_fname], [stud_mname], [stud_sname], [pasprt_fname], [fname_native], [mname_native], [sname_native], [emrgncy_cntct_name], [emrgncy_cntct_phno], [nationality_id], [born_place], [born_country_id], [parent_emp_flag], [cat_req_flag], [hostel_req], [accomodation_type_id], [aftr_care_req_flag], [gender_id], [religion_id], [cast_id], [mother_tng_id], [stud_interests], [sponsor_id], [ethnicity_id], [remarks], [transport_req_flag], [primary_cntct_flag], [upld_date_file_name], [upld_org_file_name], [upld_file_extn], [stud_dob], [comp_id], [ba_id], [bl_id], [rec_status], [update_stat], [update_id], [update_seq], [crtd_by], [course_section_alloc_id], [dt_tm], [flag]) VALUES (54126370456, 3, 54126314246, N'AN-140603-2', N'5-4-1-25-1-4126370456', NULL, 541128144, 541128325, CAST(0x0000A38C00000000 AS DateTime), 541129942, NULL, NULL, NULL, N'AC-140603-', N'Deepu', NULL, N'Christopher', NULL, N'Deepu', NULL, N'Christopher', NULL, NULL, 54112491, NULL, 10, N'A', N'I', N'I', NULL, N'I', 1, 3, 2, 1, NULL, 5412639392, 541125139, NULL, N'I', N'1', N'632014102355AMOptimized-my_passport_photo.jpg', N'Optimized-my_passport_photo.jpg', N'jpg', CAST(0x0000950800000000 AS DateTime), 5, 4, 1, N'A', N'U', 54126370456, 2, 2, 5412641144, CAST(0x0000A33F00ABCD18 AS DateTime), NULL)
INSERT [dbo].[es009000T0] ([student_id], [salutation_id], [applicant_id], [application_no], [student_no], [moe_no], [applied_course_id], [acyear_id], [stud_doj], [fee_com_subgrp_id], [apld_date], [ministry_list_stat], [house_id], [stud_code], [stud_fname], [stud_mname], [stud_sname], [pasprt_fname], [fname_native], [mname_native], [sname_native], [emrgncy_cntct_name], [emrgncy_cntct_phno], [nationality_id], [born_place], [born_country_id], [parent_emp_flag], [cat_req_flag], [hostel_req], [accomodation_type_id], [aftr_care_req_flag], [gender_id], [religion_id], [cast_id], [mother_tng_id], [stud_interests], [sponsor_id], [ethnicity_id], [remarks], [transport_req_flag], [primary_cntct_flag], [upld_date_file_name], [upld_org_file_name], [upld_file_extn], [stud_dob], [comp_id], [ba_id], [bl_id], [rec_status], [update_stat], [update_id], [update_seq], [crtd_by], [course_section_alloc_id], [dt_tm], [flag]) VALUES (54126370457, 38, 54126314247, N'AN-140609-1', N'5-4-1-25-2-4126370457', NULL, 541128144, 541128325, CAST(0x0000A34200000000 AS DateTime), 541129942, NULL, NULL, NULL, N'AC-140609-', N'Tinsha', NULL, N'Thomas', NULL, N'Tinsha', NULL, N'Thomas', NULL, NULL, 54112491, NULL, 10, N'I', N'I', N'I', NULL, N'I', 2, 3, 6, 1, NULL, NULL, 541125139, NULL, N'I', N'1', N'69201443912PMMy_Passport_size_Single_Photo.jpg', N'My_Passport_size_Single_Photo.jpg', N'jpg', CAST(0x0000950800000000 AS DateTime), 5, 4, 1, N'A', N'U', 54126370457, 2, 2, 5412641144, CAST(0x0000A3450112B629 AS DateTime), N'W')
INSERT [dbo].[es009000T0] ([student_id], [salutation_id], [applicant_id], [application_no], [student_no], [moe_no], [applied_course_id], [acyear_id], [stud_doj], [fee_com_subgrp_id], [apld_date], [ministry_list_stat], [house_id], [stud_code], [stud_fname], [stud_mname], [stud_sname], [pasprt_fname], [fname_native], [mname_native], [sname_native], [emrgncy_cntct_name], [emrgncy_cntct_phno], [nationality_id], [born_place], [born_country_id], [parent_emp_flag], [cat_req_flag], [hostel_req], [accomodation_type_id], [aftr_care_req_flag], [gender_id], [religion_id], [cast_id], [mother_tng_id], [stud_interests], [sponsor_id], [ethnicity_id], [remarks], [transport_req_flag], [primary_cntct_flag], [upld_date_file_name], [upld_org_file_name], [upld_file_extn], [stud_dob], [comp_id], [ba_id], [bl_id], [rec_status], [update_stat], [update_id], [update_seq], [crtd_by], [course_section_alloc_id], [dt_tm], [flag]) VALUES (54126370458, 3, 54126314243, N'AN-140531-3', N'5-4-1-25-1-4126370458', NULL, 541128133, 541128325, CAST(0x0000A34500000000 AS DateTime), 541129942, NULL, NULL, NULL, N'AC-140531-', N'David', NULL, N'Abraham', NULL, N'David', NULL, N'Abraham', NULL, NULL, 54112491, NULL, 10, N'I', N'I', N'A', NULL, N'I', 1, 1, 3, 1, NULL, NULL, 541125139, NULL, N'I', N'1', N'10062014095737mirfan00.jpg', N'mirfan00.jpg', N'jpg', CAST(0x0000A33C00000000 AS DateTime), 5, 4, 1, N'A', N'U', 54126370458, 2, 2, 5412641111, CAST(0x0000A34600A46415 AS DateTime), NULL)
INSERT [dbo].[es009000T0] ([student_id], [salutation_id], [applicant_id], [application_no], [student_no], [moe_no], [applied_course_id], [acyear_id], [stud_doj], [fee_com_subgrp_id], [apld_date], [ministry_list_stat], [house_id], [stud_code], [stud_fname], [stud_mname], [stud_sname], [pasprt_fname], [fname_native], [mname_native], [sname_native], [emrgncy_cntct_name], [emrgncy_cntct_phno], [nationality_id], [born_place], [born_country_id], [parent_emp_flag], [cat_req_flag], [hostel_req], [accomodation_type_id], [aftr_care_req_flag], [gender_id], [religion_id], [cast_id], [mother_tng_id], [stud_interests], [sponsor_id], [ethnicity_id], [remarks], [transport_req_flag], [primary_cntct_flag], [upld_date_file_name], [upld_org_file_name], [upld_file_extn], [stud_dob], [comp_id], [ba_id], [bl_id], [rec_status], [update_stat], [update_id], [update_seq], [crtd_by], [course_section_alloc_id], [dt_tm], [flag]) VALUES (54126370459, 3, 54126314241, N'AN-140531-1', N'5-4-1-25-1-4126370459', NULL, 541128133, 541128325, CAST(0x0000A34600000000 AS DateTime), 541129942, NULL, NULL, NULL, N'AC-140531-', N'Rahul', N'Manu', NULL, NULL, N'Rahul', N'Manu', NULL, NULL, NULL, 54112491, NULL, 10, N'I', N'I', N'I', NULL, N'I', 1, 1, 3, 1, NULL, NULL, 541125139, N'Good', N'A', N'1', N'10062014095737mirfan00.jpg', N'mirfan00.jpg', N'jpg', CAST(0x0000A33C00000000 AS DateTime), 5, 4, 1, N'A', N'U', 54126370459, 2, 2, 5412641111, CAST(0x0000A34600A4E72E AS DateTime), NULL)
INSERT [dbo].[es009000T0] ([student_id], [salutation_id], [applicant_id], [application_no], [student_no], [moe_no], [applied_course_id], [acyear_id], [stud_doj], [fee_com_subgrp_id], [apld_date], [ministry_list_stat], [house_id], [stud_code], [stud_fname], [stud_mname], [stud_sname], [pasprt_fname], [fname_native], [mname_native], [sname_native], [emrgncy_cntct_name], [emrgncy_cntct_phno], [nationality_id], [born_place], [born_country_id], [parent_emp_flag], [cat_req_flag], [hostel_req], [accomodation_type_id], [aftr_care_req_flag], [gender_id], [religion_id], [cast_id], [mother_tng_id], [stud_interests], [sponsor_id], [ethnicity_id], [remarks], [transport_req_flag], [primary_cntct_flag], [upld_date_file_name], [upld_org_file_name], [upld_file_extn], [stud_dob], [comp_id], [ba_id], [bl_id], [rec_status], [update_stat], [update_id], [update_seq], [crtd_by], [course_section_alloc_id], [dt_tm], [flag]) VALUES (54126370460, 3, 54126314243, N'AN-140531-3', N'5-4-1-25-1-4126370458', NULL, 541128133, 541128325, CAST(0x0000A34500000000 AS DateTime), 541129942, NULL, NULL, NULL, N'AC-140531-', N'David', NULL, N'Abraham', NULL, N'David', NULL, N'Abraham', NULL, NULL, 54112491, NULL, 10, N'I', N'I', N'A', NULL, N'I', 1, 1, 3, 1, NULL, NULL, 541125139, NULL, N'I', N'1', N'10062014095737mirfan00.jpg', N'mirfan00.jpg', N'jpg', CAST(0x00009D2C00000000 AS DateTime), 5, 4, 1, N'A', N'A', 54126370458, 1, 2, 5412641111, CAST(0x0000A34600AA0C09 AS DateTime), NULL)
INSERT [dbo].[es009000T0] ([student_id], [salutation_id], [applicant_id], [application_no], [student_no], [moe_no], [applied_course_id], [acyear_id], [stud_doj], [fee_com_subgrp_id], [apld_date], [ministry_list_stat], [house_id], [stud_code], [stud_fname], [stud_mname], [stud_sname], [pasprt_fname], [fname_native], [mname_native], [sname_native], [emrgncy_cntct_name], [emrgncy_cntct_phno], [nationality_id], [born_place], [born_country_id], [parent_emp_flag], [cat_req_flag], [hostel_req], [accomodation_type_id], [aftr_care_req_flag], [gender_id], [religion_id], [cast_id], [mother_tng_id], [stud_interests], [sponsor_id], [ethnicity_id], [remarks], [transport_req_flag], [primary_cntct_flag], [upld_date_file_name], [upld_org_file_name], [upld_file_extn], [stud_dob], [comp_id], [ba_id], [bl_id], [rec_status], [update_stat], [update_id], [update_seq], [crtd_by], [course_section_alloc_id], [dt_tm], [flag]) VALUES (54126370461, 38, 54126314248, N'AN-140610-1', N'5-4-1-25-2-4126370461', NULL, 541128144, 541128325, CAST(0x0000A34600000000 AS DateTime), 541129942, NULL, NULL, NULL, N'AC-140610-', N'Priyanka', NULL, N'Mathew', NULL, N'Priyanka', NULL, N'Mathew', NULL, NULL, 54112491, NULL, 10, N'I', N'I', N'I', NULL, N'I', 2, 3, 2, 1, NULL, NULL, 541125139, NULL, N'I', N'1', N'610201412938PMimagesCAAUX9KD.jpg', N'imagesCAAUX9KD.jpg', N'jpg', CAST(0x00009AB700000000 AS DateTime), 5, 4, 1, N'A', N'U', 54126370461, 2, 2, NULL, CAST(0x0000A34600DE9B84 AS DateTime), N'W')
INSERT [dbo].[es009000T0] ([student_id], [salutation_id], [applicant_id], [application_no], [student_no], [moe_no], [applied_course_id], [acyear_id], [stud_doj], [fee_com_subgrp_id], [apld_date], [ministry_list_stat], [house_id], [stud_code], [stud_fname], [stud_mname], [stud_sname], [pasprt_fname], [fname_native], [mname_native], [sname_native], [emrgncy_cntct_name], [emrgncy_cntct_phno], [nationality_id], [born_place], [born_country_id], [parent_emp_flag], [cat_req_flag], [hostel_req], [accomodation_type_id], [aftr_care_req_flag], [gender_id], [religion_id], [cast_id], [mother_tng_id], [stud_interests], [sponsor_id], [ethnicity_id], [remarks], [transport_req_flag], [primary_cntct_flag], [upld_date_file_name], [upld_org_file_name], [upld_file_extn], [stud_dob], [comp_id], [ba_id], [bl_id], [rec_status], [update_stat], [update_id], [update_seq], [crtd_by], [course_section_alloc_id], [dt_tm], [flag]) VALUES (54126370462, 38, 54126314249, N'AN-140610-2', N'5-4-1-25-2-4126370462', NULL, 541128133, 541128325, CAST(0x0000A34600000000 AS DateTime), 541129942, NULL, NULL, NULL, N'AC-140610-', N'Reema', NULL, N'Joseph', NULL, N'Reema', NULL, N'Joseph', NULL, NULL, 54112491, NULL, 10, N'I', N'I', N'I', NULL, N'I', 2, 3, 6, 1, NULL, NULL, 541125139, NULL, N'I', N'1', N'610201454933PMOptimized-my_passport_photo.jpg', N'Optimized-my_passport_photo.jpg', N'jpg', CAST(0x00009D9E00000000 AS DateTime), 5, 4, 1, N'A', N'U', 54126370462, 2, 2, NULL, CAST(0x0000A3460125F12A AS DateTime), N'W')
INSERT [dbo].[es009000T0] ([student_id], [salutation_id], [applicant_id], [application_no], [student_no], [moe_no], [applied_course_id], [acyear_id], [stud_doj], [fee_com_subgrp_id], [apld_date], [ministry_list_stat], [house_id], [stud_code], [stud_fname], [stud_mname], [stud_sname], [pasprt_fname], [fname_native], [mname_native], [sname_native], [emrgncy_cntct_name], [emrgncy_cntct_phno], [nationality_id], [born_place], [born_country_id], [parent_emp_flag], [cat_req_flag], [hostel_req], [accomodation_type_id], [aftr_care_req_flag], [gender_id], [religion_id], [cast_id], [mother_tng_id], [stud_interests], [sponsor_id], [ethnicity_id], [remarks], [transport_req_flag], [primary_cntct_flag], [upld_date_file_name], [upld_org_file_name], [upld_file_extn], [stud_dob], [comp_id], [ba_id], [bl_id], [rec_status], [update_stat], [update_id], [update_seq], [crtd_by], [course_section_alloc_id], [dt_tm], [flag]) VALUES (54126370463, 38, 54126314249, N'AN-140610-2', N'5-4-1-25-2-4126370462', NULL, 541128133, 541128325, CAST(0x0000A34600000000 AS DateTime), 541129942, NULL, NULL, NULL, N'AC-140610-', N'Reema', NULL, N'Joseph', NULL, N'Reema', NULL, N'Joseph', NULL, NULL, 54112492, NULL, 10, N'I', N'I', N'I', NULL, N'I', 2, 3, 6, 1, NULL, NULL, 541125139, NULL, N'I', N'1', N'610201454933PMOptimized-my_passport_photo.jpg', N'Optimized-my_passport_photo.jpg', N'jpg', CAST(0x00009D9E00000000 AS DateTime), 5, 4, 1, N'A', N'U', 54126370462, 3, 2, NULL, CAST(0x0000A34C00ACF1CD AS DateTime), NULL)
INSERT [dbo].[es009000T0] ([student_id], [salutation_id], [applicant_id], [application_no], [student_no], [moe_no], [applied_course_id], [acyear_id], [stud_doj], [fee_com_subgrp_id], [apld_date], [ministry_list_stat], [house_id], [stud_code], [stud_fname], [stud_mname], [stud_sname], [pasprt_fname], [fname_native], [mname_native], [sname_native], [emrgncy_cntct_name], [emrgncy_cntct_phno], [nationality_id], [born_place], [born_country_id], [parent_emp_flag], [cat_req_flag], [hostel_req], [accomodation_type_id], [aftr_care_req_flag], [gender_id], [religion_id], [cast_id], [mother_tng_id], [stud_interests], [sponsor_id], [ethnicity_id], [remarks], [transport_req_flag], [primary_cntct_flag], [upld_date_file_name], [upld_org_file_name], [upld_file_extn], [stud_dob], [comp_id], [ba_id], [bl_id], [rec_status], [update_stat], [update_id], [update_seq], [crtd_by], [course_section_alloc_id], [dt_tm], [flag]) VALUES (54126370464, 38, 54126314249, N'AN-140610-2', N'5-4-1-25-2-4126370462', NULL, 541128133, 541128325, CAST(0x0000A34600000000 AS DateTime), 541129942, NULL, NULL, NULL, N'AC-140610-', N'Reema', NULL, N'Joseph', NULL, N'Reema', NULL, N'Joseph', NULL, NULL, 541262491, NULL, 10, N'I', N'I', N'I', NULL, N'I', 2, 3, 6, 1, NULL, NULL, 541125139, NULL, N'I', N'1', N'610201454933PMOptimized-my_passport_photo.jpg', N'Optimized-my_passport_photo.jpg', N'jpg', CAST(0x00009D9E00000000 AS DateTime), 5, 4, 1, N'A', N'U', 54126370462, 4, 2, NULL, CAST(0x0000A34C00AD3214 AS DateTime), NULL)
INSERT [dbo].[es009000T0] ([student_id], [salutation_id], [applicant_id], [application_no], [student_no], [moe_no], [applied_course_id], [acyear_id], [stud_doj], [fee_com_subgrp_id], [apld_date], [ministry_list_stat], [house_id], [stud_code], [stud_fname], [stud_mname], [stud_sname], [pasprt_fname], [fname_native], [mname_native], [sname_native], [emrgncy_cntct_name], [emrgncy_cntct_phno], [nationality_id], [born_place], [born_country_id], [parent_emp_flag], [cat_req_flag], [hostel_req], [accomodation_type_id], [aftr_care_req_flag], [gender_id], [religion_id], [cast_id], [mother_tng_id], [stud_interests], [sponsor_id], [ethnicity_id], [remarks], [transport_req_flag], [primary_cntct_flag], [upld_date_file_name], [upld_org_file_name], [upld_file_extn], [stud_dob], [comp_id], [ba_id], [bl_id], [rec_status], [update_stat], [update_id], [update_seq], [crtd_by], [course_section_alloc_id], [dt_tm], [flag]) VALUES (54126370465, 38, 54126314249, N'AN-140610-2', N'5-4-1-25-2-4126370462', NULL, 541128133, 541128325, CAST(0x0000A34600000000 AS DateTime), 541129942, NULL, NULL, NULL, N'AC-140610-', N'Reema', NULL, N'Joseph', NULL, N'Reema', NULL, N'Joseph', NULL, NULL, 541262492, NULL, 10, N'I', N'I', N'I', NULL, N'I', 2, 3, 6, 1, NULL, NULL, 541125139, NULL, N'I', N'1', N'610201454933PMOptimized-my_passport_photo.jpg', N'Optimized-my_passport_photo.jpg', N'jpg', CAST(0x00009D9E00000000 AS DateTime), 5, 4, 1, N'A', N'U', 54126370462, 5, 2, NULL, CAST(0x0000A34C00AD472D AS DateTime), NULL)
INSERT [dbo].[es009000T0] ([student_id], [salutation_id], [applicant_id], [application_no], [student_no], [moe_no], [applied_course_id], [acyear_id], [stud_doj], [fee_com_subgrp_id], [apld_date], [ministry_list_stat], [house_id], [stud_code], [stud_fname], [stud_mname], [stud_sname], [pasprt_fname], [fname_native], [mname_native], [sname_native], [emrgncy_cntct_name], [emrgncy_cntct_phno], [nationality_id], [born_place], [born_country_id], [parent_emp_flag], [cat_req_flag], [hostel_req], [accomodation_type_id], [aftr_care_req_flag], [gender_id], [religion_id], [cast_id], [mother_tng_id], [stud_interests], [sponsor_id], [ethnicity_id], [remarks], [transport_req_flag], [primary_cntct_flag], [upld_date_file_name], [upld_org_file_name], [upld_file_extn], [stud_dob], [comp_id], [ba_id], [bl_id], [rec_status], [update_stat], [update_id], [update_seq], [crtd_by], [course_section_alloc_id], [dt_tm], [flag]) VALUES (54126370466, 38, 54126314249, N'AN-140610-2', N'5-4-1-25-2-4126370462', NULL, 541128133, 541128325, CAST(0x0000A34600000000 AS DateTime), 541129942, NULL, NULL, NULL, N'AC-140610-', N'Reema', NULL, N'Joseph', NULL, N'Reema', NULL, N'Joseph', NULL, NULL, 54112491, NULL, 10, N'I', N'I', N'I', NULL, N'I', 2, 3, 6, 1, NULL, NULL, 541125139, NULL, N'I', N'1', N'610201454933PMOptimized-my_passport_photo.jpg', N'Optimized-my_passport_photo.jpg', N'jpg', CAST(0x00009D9E00000000 AS DateTime), 5, 4, 1, N'A', N'U', 54126370462, 6, 2, NULL, CAST(0x0000A34C00AD5710 AS DateTime), NULL)
INSERT [dbo].[es009000T0] ([student_id], [salutation_id], [applicant_id], [application_no], [student_no], [moe_no], [applied_course_id], [acyear_id], [stud_doj], [fee_com_subgrp_id], [apld_date], [ministry_list_stat], [house_id], [stud_code], [stud_fname], [stud_mname], [stud_sname], [pasprt_fname], [fname_native], [mname_native], [sname_native], [emrgncy_cntct_name], [emrgncy_cntct_phno], [nationality_id], [born_place], [born_country_id], [parent_emp_flag], [cat_req_flag], [hostel_req], [accomodation_type_id], [aftr_care_req_flag], [gender_id], [religion_id], [cast_id], [mother_tng_id], [stud_interests], [sponsor_id], [ethnicity_id], [remarks], [transport_req_flag], [primary_cntct_flag], [upld_date_file_name], [upld_org_file_name], [upld_file_extn], [stud_dob], [comp_id], [ba_id], [bl_id], [rec_status], [update_stat], [update_id], [update_seq], [crtd_by], [course_section_alloc_id], [dt_tm], [flag]) VALUES (54126370467, 3, 54126314251, N'AN-140616-2', N'5-4-1-25-1-4126370467', NULL, 541128139, 541128325, CAST(0x0000A34C00000000 AS DateTime), 541129942, NULL, NULL, 541263747, N'AC-140616-', N'Mohan', NULL, N'John', NULL, N'Mohan', NULL, N'John', NULL, NULL, 54112491, NULL, 10, N'I', N'I', N'I', NULL, N'I', 1, 1, 3, 1, NULL, NULL, 541125139, NULL, N'I', N'1', N'16062014105503Optimized-my_passport_photo.jpg', N'Optimized-my_passport_photo.jpg', N'jpg', CAST(0x0000A34C00000000 AS DateTime), 5, 4, 1, N'A', N'U', 54126370467, 2, 2, 5412641151, CAST(0x0000A34C00B42E93 AS DateTime), N'W')
INSERT [dbo].[es009000T0] ([student_id], [salutation_id], [applicant_id], [application_no], [student_no], [moe_no], [applied_course_id], [acyear_id], [stud_doj], [fee_com_subgrp_id], [apld_date], [ministry_list_stat], [house_id], [stud_code], [stud_fname], [stud_mname], [stud_sname], [pasprt_fname], [fname_native], [mname_native], [sname_native], [emrgncy_cntct_name], [emrgncy_cntct_phno], [nationality_id], [born_place], [born_country_id], [parent_emp_flag], [cat_req_flag], [hostel_req], [accomodation_type_id], [aftr_care_req_flag], [gender_id], [religion_id], [cast_id], [mother_tng_id], [stud_interests], [sponsor_id], [ethnicity_id], [remarks], [transport_req_flag], [primary_cntct_flag], [upld_date_file_name], [upld_org_file_name], [upld_file_extn], [stud_dob], [comp_id], [ba_id], [bl_id], [rec_status], [update_stat], [update_id], [update_seq], [crtd_by], [course_section_alloc_id], [dt_tm], [flag]) VALUES (54126370468, 3, 54126314250, N'AN-140616-1', N'5-4-1-25-1-4126370468', NULL, 541128133, 541128325, CAST(0x0000A34C00000000 AS DateTime), 541129942, NULL, NULL, NULL, N'AC-140616-', N'Babu', NULL, N'John', NULL, N'Babu', NULL, N'John', NULL, NULL, 54112491, NULL, 10, N'I', N'I', N'I', NULL, N'I', 1, 1, 3, 1, NULL, NULL, 541125139, NULL, N'I', N'1', N'16062014111814Optimized-my_passport_photo.jpg', N'Optimized-my_passport_photo.jpg', N'jpg', CAST(0x0000A34C00000000 AS DateTime), 5, 4, 1, N'A', N'U', 54126370468, 2, 2, NULL, CAST(0x0000A34C00BA844E AS DateTime), N'W')
INSERT [dbo].[es009000T0] ([student_id], [salutation_id], [applicant_id], [application_no], [student_no], [moe_no], [applied_course_id], [acyear_id], [stud_doj], [fee_com_subgrp_id], [apld_date], [ministry_list_stat], [house_id], [stud_code], [stud_fname], [stud_mname], [stud_sname], [pasprt_fname], [fname_native], [mname_native], [sname_native], [emrgncy_cntct_name], [emrgncy_cntct_phno], [nationality_id], [born_place], [born_country_id], [parent_emp_flag], [cat_req_flag], [hostel_req], [accomodation_type_id], [aftr_care_req_flag], [gender_id], [religion_id], [cast_id], [mother_tng_id], [stud_interests], [sponsor_id], [ethnicity_id], [remarks], [transport_req_flag], [primary_cntct_flag], [upld_date_file_name], [upld_org_file_name], [upld_file_extn], [stud_dob], [comp_id], [ba_id], [bl_id], [rec_status], [update_stat], [update_id], [update_seq], [crtd_by], [course_section_alloc_id], [dt_tm], [flag]) VALUES (54126370469, 38, 54126314249, N'AN-140610-2', N'5-4-1-25-2-4126370462', NULL, 541128133, 541128325, CAST(0x0000A34600000000 AS DateTime), 541129942, NULL, NULL, NULL, N'AC-140610-', N'Reema', NULL, N'Joseph', NULL, N'Reema', NULL, N'Joseph', NULL, NULL, 54112491, NULL, 10, N'I', N'I', N'I', NULL, N'I', 2, 3, 6, 1, NULL, NULL, 541125139, NULL, N'I', N'1', N'610201454933PMOptimized-my_passport_photo.jpg', N'Optimized-my_passport_photo.jpg', N'jpg', CAST(0x00009D9E00000000 AS DateTime), 5, 4, 1, N'A', N'U', 54126370462, 7, 2, 5412641111, CAST(0x0000A34D0112EDA5 AS DateTime), N'A')
INSERT [dbo].[es009000T0] ([student_id], [salutation_id], [applicant_id], [application_no], [student_no], [moe_no], [applied_course_id], [acyear_id], [stud_doj], [fee_com_subgrp_id], [apld_date], [ministry_list_stat], [house_id], [stud_code], [stud_fname], [stud_mname], [stud_sname], [pasprt_fname], [fname_native], [mname_native], [sname_native], [emrgncy_cntct_name], [emrgncy_cntct_phno], [nationality_id], [born_place], [born_country_id], [parent_emp_flag], [cat_req_flag], [hostel_req], [accomodation_type_id], [aftr_care_req_flag], [gender_id], [religion_id], [cast_id], [mother_tng_id], [stud_interests], [sponsor_id], [ethnicity_id], [remarks], [transport_req_flag], [primary_cntct_flag], [upld_date_file_name], [upld_org_file_name], [upld_file_extn], [stud_dob], [comp_id], [ba_id], [bl_id], [rec_status], [update_stat], [update_id], [update_seq], [crtd_by], [course_section_alloc_id], [dt_tm], [flag]) VALUES (54126370470, 38, 54126314248, N'AN-140610-1', N'5-4-1-25-2-4126370461', NULL, 541128144, 541128325, CAST(0x0000A34600000000 AS DateTime), 541129942, NULL, NULL, NULL, N'AC-140610-', N'Priyanka', NULL, N'Mathew', NULL, N'Priyanka', NULL, N'Mathew', NULL, NULL, 54112491, NULL, 10, N'I', N'I', N'I', NULL, N'I', 2, 3, 2, 1, NULL, NULL, 541125139, NULL, N'I', N'1', N'610201412938PMimagesCAAUX9KD.jpg', N'imagesCAAUX9KD.jpg', N'jpg', CAST(0x00009AB700000000 AS DateTime), 5, 4, 1, N'A', N'A', 54126370461, 1, 2, 5412641144, CAST(0x0000A34F00AE12A5 AS DateTime), NULL)
INSERT [dbo].[es009000T0] ([student_id], [salutation_id], [applicant_id], [application_no], [student_no], [moe_no], [applied_course_id], [acyear_id], [stud_doj], [fee_com_subgrp_id], [apld_date], [ministry_list_stat], [house_id], [stud_code], [stud_fname], [stud_mname], [stud_sname], [pasprt_fname], [fname_native], [mname_native], [sname_native], [emrgncy_cntct_name], [emrgncy_cntct_phno], [nationality_id], [born_place], [born_country_id], [parent_emp_flag], [cat_req_flag], [hostel_req], [accomodation_type_id], [aftr_care_req_flag], [gender_id], [religion_id], [cast_id], [mother_tng_id], [stud_interests], [sponsor_id], [ethnicity_id], [remarks], [transport_req_flag], [primary_cntct_flag], [upld_date_file_name], [upld_org_file_name], [upld_file_extn], [stud_dob], [comp_id], [ba_id], [bl_id], [rec_status], [update_stat], [update_id], [update_seq], [crtd_by], [course_section_alloc_id], [dt_tm], [flag]) VALUES (54126370471, 3, 54126314251, N'AN-140616-2', N'5-4-1-25-1-4126370467', NULL, 541128139, 541128325, CAST(0x0000A34C00000000 AS DateTime), 541129942, NULL, NULL, 541263747, N'AC-140616-', N'Mohan', NULL, N'John', NULL, N'Mohan', NULL, N'John', NULL, NULL, 54112491, NULL, 10, N'I', N'I', N'I', NULL, N'I', 1, 1, 3, 1, NULL, NULL, 541125139, NULL, N'I', N'1', N'16062014105503Optimized-my_passport_photo.jpg', N'Optimized-my_passport_photo.jpg', N'jpg', CAST(0x0000A34C00000000 AS DateTime), 5, 4, 1, N'A', N'U', 54126370467, 3, 2, 5412641151, CAST(0x0000A34F00AEBB70 AS DateTime), NULL)
INSERT [dbo].[es009000T0] ([student_id], [salutation_id], [applicant_id], [application_no], [student_no], [moe_no], [applied_course_id], [acyear_id], [stud_doj], [fee_com_subgrp_id], [apld_date], [ministry_list_stat], [house_id], [stud_code], [stud_fname], [stud_mname], [stud_sname], [pasprt_fname], [fname_native], [mname_native], [sname_native], [emrgncy_cntct_name], [emrgncy_cntct_phno], [nationality_id], [born_place], [born_country_id], [parent_emp_flag], [cat_req_flag], [hostel_req], [accomodation_type_id], [aftr_care_req_flag], [gender_id], [religion_id], [cast_id], [mother_tng_id], [stud_interests], [sponsor_id], [ethnicity_id], [remarks], [transport_req_flag], [primary_cntct_flag], [upld_date_file_name], [upld_org_file_name], [upld_file_extn], [stud_dob], [comp_id], [ba_id], [bl_id], [rec_status], [update_stat], [update_id], [update_seq], [crtd_by], [course_section_alloc_id], [dt_tm], [flag]) VALUES (54126370472, 3, 54126314250, N'AN-140616-1', N'5-4-1-25-1-4126370468', NULL, 541128133, 541128325, CAST(0x0000A34C00000000 AS DateTime), 541129942, NULL, NULL, NULL, N'AC-140616-', N'Babu', NULL, N'John', NULL, N'Babu', NULL, N'John', NULL, NULL, 54112491, NULL, 10, N'I', N'I', N'I', NULL, N'I', 1, 1, 3, 1, NULL, NULL, 541125139, NULL, N'I', N'1', N'16062014111814Optimized-my_passport_photo.jpg', N'Optimized-my_passport_photo.jpg', N'jpg', CAST(0x0000A34C00000000 AS DateTime), 5, 4, 1, N'A', N'U', 54126370468, 3, 2, 5412641111, CAST(0x0000A34F00AEC835 AS DateTime), NULL)
INSERT [dbo].[es009000T0] ([student_id], [salutation_id], [applicant_id], [application_no], [student_no], [moe_no], [applied_course_id], [acyear_id], [stud_doj], [fee_com_subgrp_id], [apld_date], [ministry_list_stat], [house_id], [stud_code], [stud_fname], [stud_mname], [stud_sname], [pasprt_fname], [fname_native], [mname_native], [sname_native], [emrgncy_cntct_name], [emrgncy_cntct_phno], [nationality_id], [born_place], [born_country_id], [parent_emp_flag], [cat_req_flag], [hostel_req], [accomodation_type_id], [aftr_care_req_flag], [gender_id], [religion_id], [cast_id], [mother_tng_id], [stud_interests], [sponsor_id], [ethnicity_id], [remarks], [transport_req_flag], [primary_cntct_flag], [upld_date_file_name], [upld_org_file_name], [upld_file_extn], [stud_dob], [comp_id], [ba_id], [bl_id], [rec_status], [update_stat], [update_id], [update_seq], [crtd_by], [course_section_alloc_id], [dt_tm], [flag]) VALUES (54126370473, 38, 54126314249, N'AN-140610-2', N'5-4-1-25-2-4126370462', NULL, 541128133, 541128325, CAST(0x0000A34600000000 AS DateTime), 541129942, NULL, NULL, 541263747, N'AC-140610-', N'Reema', NULL, N'Joseph', NULL, N'Reema', NULL, N'Joseph', NULL, NULL, 54112491, NULL, 10, N'I', N'I', N'I', NULL, N'I', 2, 3, 6, 1, NULL, NULL, 541125139, NULL, N'I', N'1', N'610201454933PMOptimized-my_passport_photo.jpg', N'Optimized-my_passport_photo.jpg', N'jpg', CAST(0x00009D9E00000000 AS DateTime), 5, 4, 1, N'A', N'A', 54126370462, 1, 2, 5412641111, CAST(0x0000A34F00B2C839 AS DateTime), NULL)
INSERT [dbo].[es009000T0] ([student_id], [salutation_id], [applicant_id], [application_no], [student_no], [moe_no], [applied_course_id], [acyear_id], [stud_doj], [fee_com_subgrp_id], [apld_date], [ministry_list_stat], [house_id], [stud_code], [stud_fname], [stud_mname], [stud_sname], [pasprt_fname], [fname_native], [mname_native], [sname_native], [emrgncy_cntct_name], [emrgncy_cntct_phno], [nationality_id], [born_place], [born_country_id], [parent_emp_flag], [cat_req_flag], [hostel_req], [accomodation_type_id], [aftr_care_req_flag], [gender_id], [religion_id], [cast_id], [mother_tng_id], [stud_interests], [sponsor_id], [ethnicity_id], [remarks], [transport_req_flag], [primary_cntct_flag], [upld_date_file_name], [upld_org_file_name], [upld_file_extn], [stud_dob], [comp_id], [ba_id], [bl_id], [rec_status], [update_stat], [update_id], [update_seq], [crtd_by], [course_section_alloc_id], [dt_tm], [flag]) VALUES (54126370474, 3, 54126314252, N'AN-140619-1', N'5-4-1-25-1-4126370474', NULL, 541128133, 541128325, CAST(0x0000A34F00000000 AS DateTime), 541129942, NULL, NULL, NULL, N'Ac-140619-', N'David', NULL, N'Villa', NULL, N'David', NULL, N'Villa', NULL, NULL, 54112491, NULL, 10, N'I', N'I', N'I', NULL, N'I', 1, 1, 3, 1, NULL, NULL, 541125139, NULL, N'I', N'1', N'19062014174313Koala.jpg', N'Koala.jpg', N'jpg', CAST(0x0000995000000000 AS DateTime), 5, 4, 1, N'A', N'U', 54126370474, 6, 2, 5412641111, CAST(0x0000A34F01244081 AS DateTime), N'S')
INSERT [dbo].[es009000T0] ([student_id], [salutation_id], [applicant_id], [application_no], [student_no], [moe_no], [applied_course_id], [acyear_id], [stud_doj], [fee_com_subgrp_id], [apld_date], [ministry_list_stat], [house_id], [stud_code], [stud_fname], [stud_mname], [stud_sname], [pasprt_fname], [fname_native], [mname_native], [sname_native], [emrgncy_cntct_name], [emrgncy_cntct_phno], [nationality_id], [born_place], [born_country_id], [parent_emp_flag], [cat_req_flag], [hostel_req], [accomodation_type_id], [aftr_care_req_flag], [gender_id], [religion_id], [cast_id], [mother_tng_id], [stud_interests], [sponsor_id], [ethnicity_id], [remarks], [transport_req_flag], [primary_cntct_flag], [upld_date_file_name], [upld_org_file_name], [upld_file_extn], [stud_dob], [comp_id], [ba_id], [bl_id], [rec_status], [update_stat], [update_id], [update_seq], [crtd_by], [course_section_alloc_id], [dt_tm], [flag]) VALUES (54126370475, 3, 54126314253, N'AN-140619-2', N'5-4-1-25-1-4126370475', NULL, 541128133, 541128325, CAST(0x0000A34F00000000 AS DateTime), 541129942, NULL, NULL, NULL, N'AC-140619-', N'Segio', NULL, N'Ramos', NULL, N'Segio', NULL, N'Ramos', NULL, NULL, 54112491, NULL, 10, N'I', N'I', N'I', NULL, N'I', 1, 1, 3, 1, NULL, NULL, 541125140, NULL, N'I', N'1', N'19062014174313mirfan07.jpg', N'mirfan07.jpg', N'jpg', CAST(0x0000995700000000 AS DateTime), 5, 4, 1, N'A', N'A', 54126370475, 1, 2, 5412641111, CAST(0x0000A34F01247F31 AS DateTime), NULL)
INSERT [dbo].[es009000T0] ([student_id], [salutation_id], [applicant_id], [application_no], [student_no], [moe_no], [applied_course_id], [acyear_id], [stud_doj], [fee_com_subgrp_id], [apld_date], [ministry_list_stat], [house_id], [stud_code], [stud_fname], [stud_mname], [stud_sname], [pasprt_fname], [fname_native], [mname_native], [sname_native], [emrgncy_cntct_name], [emrgncy_cntct_phno], [nationality_id], [born_place], [born_country_id], [parent_emp_flag], [cat_req_flag], [hostel_req], [accomodation_type_id], [aftr_care_req_flag], [gender_id], [religion_id], [cast_id], [mother_tng_id], [stud_interests], [sponsor_id], [ethnicity_id], [remarks], [transport_req_flag], [primary_cntct_flag], [upld_date_file_name], [upld_org_file_name], [upld_file_extn], [stud_dob], [comp_id], [ba_id], [bl_id], [rec_status], [update_stat], [update_id], [update_seq], [crtd_by], [course_section_alloc_id], [dt_tm], [flag]) VALUES (54126370476, 3, 54126314254, N'AN-140619-3', N'5-4-1-25-1-4126370476', NULL, 541128133, 541128325, CAST(0x0000A34F00000000 AS DateTime), 541129942, NULL, NULL, NULL, N'AC-140619-', N'Geran', NULL, N'Peque', NULL, N'Geran', NULL, N'Peque', NULL, NULL, 54112491, NULL, 10, N'I', N'I', N'I', NULL, N'I', 1, 1, 3, 1, NULL, NULL, 541125139, NULL, N'I', N'1', N'19062014174313My_Passport_size_Single_Photo.jpg', N'My_Passport_size_Single_Photo.jpg', N'jpg', CAST(0x0000A34F00000000 AS DateTime), 5, 4, 1, N'A', N'U', 54126370476, 2, 2, 5412641111, CAST(0x0000A34F0124A667 AS DateTime), NULL)
INSERT [dbo].[es009000T0] ([student_id], [salutation_id], [applicant_id], [application_no], [student_no], [moe_no], [applied_course_id], [acyear_id], [stud_doj], [fee_com_subgrp_id], [apld_date], [ministry_list_stat], [house_id], [stud_code], [stud_fname], [stud_mname], [stud_sname], [pasprt_fname], [fname_native], [mname_native], [sname_native], [emrgncy_cntct_name], [emrgncy_cntct_phno], [nationality_id], [born_place], [born_country_id], [parent_emp_flag], [cat_req_flag], [hostel_req], [accomodation_type_id], [aftr_care_req_flag], [gender_id], [religion_id], [cast_id], [mother_tng_id], [stud_interests], [sponsor_id], [ethnicity_id], [remarks], [transport_req_flag], [primary_cntct_flag], [upld_date_file_name], [upld_org_file_name], [upld_file_extn], [stud_dob], [comp_id], [ba_id], [bl_id], [rec_status], [update_stat], [update_id], [update_seq], [crtd_by], [course_section_alloc_id], [dt_tm], [flag]) VALUES (54126370479, 3, 54126314244, N'AN-140602-1', N'5-4-1-25-1-4126370454', NULL, 541128134, 541128325, CAST(0x0000A35500000000 AS DateTime), NULL, NULL, NULL, 541263747, N'AC-140602-', N'John', NULL, N'Abraham', NULL, N'John', NULL, N'Abraham', NULL, NULL, 54112491, NULL, 10, N'A', N'I', N'I', NULL, N'I', 1, 3, 2, 1, NULL, 5412639389, 541125139, NULL, N'I', N'1', N'622014122416PMMy_Passport_size_Single_Photo.jpg', N'My_Passport_size_Single_Photo.jpg', N'jpg', CAST(0x0000995400000000 AS DateTime), 5, 4, 1, N'A', N'U', 54126370454, 4, 2, 5412641115, CAST(0x0000A35300F370B9 AS DateTime), N'E')
INSERT [dbo].[es009000T0] ([student_id], [salutation_id], [applicant_id], [application_no], [student_no], [moe_no], [applied_course_id], [acyear_id], [stud_doj], [fee_com_subgrp_id], [apld_date], [ministry_list_stat], [house_id], [stud_code], [stud_fname], [stud_mname], [stud_sname], [pasprt_fname], [fname_native], [mname_native], [sname_native], [emrgncy_cntct_name], [emrgncy_cntct_phno], [nationality_id], [born_place], [born_country_id], [parent_emp_flag], [cat_req_flag], [hostel_req], [accomodation_type_id], [aftr_care_req_flag], [gender_id], [religion_id], [cast_id], [mother_tng_id], [stud_interests], [sponsor_id], [ethnicity_id], [remarks], [transport_req_flag], [primary_cntct_flag], [upld_date_file_name], [upld_org_file_name], [upld_file_extn], [stud_dob], [comp_id], [ba_id], [bl_id], [rec_status], [update_stat], [update_id], [update_seq], [crtd_by], [course_section_alloc_id], [dt_tm], [flag]) VALUES (54126370480, 3, 54126314244, N'AN-140602-1', N'5-4-1-25-1-4126370454', NULL, 541128134, 541128325, CAST(0x0000A35500000000 AS DateTime), NULL, NULL, NULL, 541263747, N'AC-140602-', N'John', NULL, N'Abraham', NULL, N'John', NULL, N'Abraham', NULL, NULL, 54112491, NULL, 10, N'A', N'I', N'I', NULL, N'I', 1, 3, 2, 1, NULL, 5412639389, 541125139, NULL, N'I', N'1', N'622014122416PMMy_Passport_size_Single_Photo.jpg', N'My_Passport_size_Single_Photo.jpg', N'jpg', CAST(0x0000995400000000 AS DateTime), 5, 4, 1, N'A', N'U', 54126370454, 5, 2, 5412641115, CAST(0x0000A35300F3C20E AS DateTime), N'E')
INSERT [dbo].[es009000T0] ([student_id], [salutation_id], [applicant_id], [application_no], [student_no], [moe_no], [applied_course_id], [acyear_id], [stud_doj], [fee_com_subgrp_id], [apld_date], [ministry_list_stat], [house_id], [stud_code], [stud_fname], [stud_mname], [stud_sname], [pasprt_fname], [fname_native], [mname_native], [sname_native], [emrgncy_cntct_name], [emrgncy_cntct_phno], [nationality_id], [born_place], [born_country_id], [parent_emp_flag], [cat_req_flag], [hostel_req], [accomodation_type_id], [aftr_care_req_flag], [gender_id], [religion_id], [cast_id], [mother_tng_id], [stud_interests], [sponsor_id], [ethnicity_id], [remarks], [transport_req_flag], [primary_cntct_flag], [upld_date_file_name], [upld_org_file_name], [upld_file_extn], [stud_dob], [comp_id], [ba_id], [bl_id], [rec_status], [update_stat], [update_id], [update_seq], [crtd_by], [course_section_alloc_id], [dt_tm], [flag]) VALUES (54126370481, 3, 54126314244, N'AN-140602-1', N'5-4-1-25-1-4126370454', NULL, 541128134, 541128325, CAST(0x0000A34300000000 AS DateTime), NULL, NULL, NULL, 541263747, N'AC-140602-', N'John', NULL, N'Abraham', NULL, N'John', NULL, N'Abraham', NULL, NULL, 54112491, NULL, 10, N'A', N'I', N'I', NULL, N'I', 1, 3, 2, 1, NULL, 5412639389, 541125139, NULL, N'I', N'1', N'622014122416PMMy_Passport_size_Single_Photo.jpg', N'My_Passport_size_Single_Photo.jpg', N'jpg', CAST(0x0000995400000000 AS DateTime), 5, 4, 1, N'A', N'A', 54126370454, 1, 2, 5412641115, CAST(0x0000A35400B5E2FB AS DateTime), NULL)
INSERT [dbo].[es009000T0] ([student_id], [salutation_id], [applicant_id], [application_no], [student_no], [moe_no], [applied_course_id], [acyear_id], [stud_doj], [fee_com_subgrp_id], [apld_date], [ministry_list_stat], [house_id], [stud_code], [stud_fname], [stud_mname], [stud_sname], [pasprt_fname], [fname_native], [mname_native], [sname_native], [emrgncy_cntct_name], [emrgncy_cntct_phno], [nationality_id], [born_place], [born_country_id], [parent_emp_flag], [cat_req_flag], [hostel_req], [accomodation_type_id], [aftr_care_req_flag], [gender_id], [religion_id], [cast_id], [mother_tng_id], [stud_interests], [sponsor_id], [ethnicity_id], [remarks], [transport_req_flag], [primary_cntct_flag], [upld_date_file_name], [upld_org_file_name], [upld_file_extn], [stud_dob], [comp_id], [ba_id], [bl_id], [rec_status], [update_stat], [update_id], [update_seq], [crtd_by], [course_section_alloc_id], [dt_tm], [flag]) VALUES (54126370482, 3, 54126314246, N'AN-140603-2', N'5-4-1-25-1-4126370456', NULL, 541128144, 541128325, CAST(0x0000A33F00000000 AS DateTime), 541129942, NULL, NULL, NULL, N'AC-140603-', N'Deepu', NULL, N'Christopher', NULL, N'Deepu', NULL, N'Christopher', NULL, NULL, 54112491, NULL, 10, N'A', N'I', N'I', NULL, N'I', 1, 3, 2, 1, NULL, 5412639392, 541125139, NULL, N'I', N'1', N'632014102355AMOptimized-my_passport_photo.jpg', N'Optimized-my_passport_photo.jpg', N'jpg', CAST(0x0000950800000000 AS DateTime), 5, 4, 1, N'A', N'A', 54126370456, 1, 2, 5412641144, CAST(0x0000A35400B659BC AS DateTime), NULL)
INSERT [dbo].[es009000T0] ([student_id], [salutation_id], [applicant_id], [application_no], [student_no], [moe_no], [applied_course_id], [acyear_id], [stud_doj], [fee_com_subgrp_id], [apld_date], [ministry_list_stat], [house_id], [stud_code], [stud_fname], [stud_mname], [stud_sname], [pasprt_fname], [fname_native], [mname_native], [sname_native], [emrgncy_cntct_name], [emrgncy_cntct_phno], [nationality_id], [born_place], [born_country_id], [parent_emp_flag], [cat_req_flag], [hostel_req], [accomodation_type_id], [aftr_care_req_flag], [gender_id], [religion_id], [cast_id], [mother_tng_id], [stud_interests], [sponsor_id], [ethnicity_id], [remarks], [transport_req_flag], [primary_cntct_flag], [upld_date_file_name], [upld_org_file_name], [upld_file_extn], [stud_dob], [comp_id], [ba_id], [bl_id], [rec_status], [update_stat], [update_id], [update_seq], [crtd_by], [course_section_alloc_id], [dt_tm], [flag]) VALUES (54126370483, 3, 54126314254, N'AN-140619-3', N'5-4-1-25-1-4126370476', NULL, 541128133, 541128325, CAST(0x0000A34F00000000 AS DateTime), 541129942, NULL, NULL, NULL, N'AC-140619-', N'Geran', NULL, N'Peque', NULL, N'Geran', NULL, N'Peque', NULL, NULL, 54112491, NULL, 10, N'I', N'I', N'I', NULL, N'I', 1, 1, 3, 1, NULL, NULL, 541125139, NULL, N'I', N'1', N'19062014174313My_Passport_size_Single_Photo.jpg', N'My_Passport_size_Single_Photo.jpg', N'jpg', CAST(0x00009EE800000000 AS DateTime), 5, 4, 1, N'A', N'A', 54126370476, 1, 2, 5412641111, CAST(0x0000A35400EBEB1C AS DateTime), NULL)
INSERT [dbo].[es009000T0] ([student_id], [salutation_id], [applicant_id], [application_no], [student_no], [moe_no], [applied_course_id], [acyear_id], [stud_doj], [fee_com_subgrp_id], [apld_date], [ministry_list_stat], [house_id], [stud_code], [stud_fname], [stud_mname], [stud_sname], [pasprt_fname], [fname_native], [mname_native], [sname_native], [emrgncy_cntct_name], [emrgncy_cntct_phno], [nationality_id], [born_place], [born_country_id], [parent_emp_flag], [cat_req_flag], [hostel_req], [accomodation_type_id], [aftr_care_req_flag], [gender_id], [religion_id], [cast_id], [mother_tng_id], [stud_interests], [sponsor_id], [ethnicity_id], [remarks], [transport_req_flag], [primary_cntct_flag], [upld_date_file_name], [upld_org_file_name], [upld_file_extn], [stud_dob], [comp_id], [ba_id], [bl_id], [rec_status], [update_stat], [update_id], [update_seq], [crtd_by], [course_section_alloc_id], [dt_tm], [flag]) VALUES (54126370484, 3, 54126314250, N'AN-140616-1', N'5-4-1-25-1-4126370468', NULL, 541128133, 541128325, CAST(0x0000A34C00000000 AS DateTime), 541129942, NULL, NULL, NULL, N'AC-140616-', N'Babu', NULL, N'John', NULL, N'Babu', NULL, N'John', NULL, NULL, 54112491, NULL, 10, N'I', N'I', N'I', NULL, N'I', 1, 1, 3, 1, NULL, NULL, 541125139, NULL, N'I', N'1', N'16062014111814Optimized-my_passport_photo.jpg', N'Optimized-my_passport_photo.jpg', N'jpg', CAST(0x00009F0400000000 AS DateTime), 5, 4, 1, N'A', N'A', 54126370468, 1, 2, 5412641111, CAST(0x0000A35400EC10D3 AS DateTime), NULL)
INSERT [dbo].[es009000T0] ([student_id], [salutation_id], [applicant_id], [application_no], [student_no], [moe_no], [applied_course_id], [acyear_id], [stud_doj], [fee_com_subgrp_id], [apld_date], [ministry_list_stat], [house_id], [stud_code], [stud_fname], [stud_mname], [stud_sname], [pasprt_fname], [fname_native], [mname_native], [sname_native], [emrgncy_cntct_name], [emrgncy_cntct_phno], [nationality_id], [born_place], [born_country_id], [parent_emp_flag], [cat_req_flag], [hostel_req], [accomodation_type_id], [aftr_care_req_flag], [gender_id], [religion_id], [cast_id], [mother_tng_id], [stud_interests], [sponsor_id], [ethnicity_id], [remarks], [transport_req_flag], [primary_cntct_flag], [upld_date_file_name], [upld_org_file_name], [upld_file_extn], [stud_dob], [comp_id], [ba_id], [bl_id], [rec_status], [update_stat], [update_id], [update_seq], [crtd_by], [course_section_alloc_id], [dt_tm], [flag]) VALUES (54126370485, 3, 54126314251, N'AN-140616-2', N'5-4-1-25-1-4126370467', NULL, 541128139, 541128325, CAST(0x0000A34C00000000 AS DateTime), 541129942, NULL, NULL, 541263747, N'AC-140616-', N'Mohan', NULL, N'John', NULL, N'Mohan', NULL, N'John', NULL, NULL, 54112491, NULL, 10, N'I', N'I', N'I', NULL, N'I', 1, 1, 3, 1, NULL, NULL, 541125139, NULL, N'I', N'1', N'16062014105503Optimized-my_passport_photo.jpg', N'Optimized-my_passport_photo.jpg', N'jpg', CAST(0x00009F0400000000 AS DateTime), 5, 4, 1, N'A', N'U', 54126370467, 4, 2, 5412641151, CAST(0x0000A35400EC275E AS DateTime), NULL)
INSERT [dbo].[es009000T0] ([student_id], [salutation_id], [applicant_id], [application_no], [student_no], [moe_no], [applied_course_id], [acyear_id], [stud_doj], [fee_com_subgrp_id], [apld_date], [ministry_list_stat], [house_id], [stud_code], [stud_fname], [stud_mname], [stud_sname], [pasprt_fname], [fname_native], [mname_native], [sname_native], [emrgncy_cntct_name], [emrgncy_cntct_phno], [nationality_id], [born_place], [born_country_id], [parent_emp_flag], [cat_req_flag], [hostel_req], [accomodation_type_id], [aftr_care_req_flag], [gender_id], [religion_id], [cast_id], [mother_tng_id], [stud_interests], [sponsor_id], [ethnicity_id], [remarks], [transport_req_flag], [primary_cntct_flag], [upld_date_file_name], [upld_org_file_name], [upld_file_extn], [stud_dob], [comp_id], [ba_id], [bl_id], [rec_status], [update_stat], [update_id], [update_seq], [crtd_by], [course_section_alloc_id], [dt_tm], [flag]) VALUES (54126370486, 3, 54126314241, N'AN-140531-1', N'5-4-1-25-1-4126370459', NULL, 541128133, 541128325, CAST(0x0000A34600000000 AS DateTime), 541129942, NULL, NULL, NULL, N'AC-140531-', N'Rahul', N'Manu', NULL, NULL, N'Rahul', N'Manu', NULL, NULL, NULL, 54112491, NULL, 10, N'I', N'I', N'I', NULL, N'I', 1, 1, 3, 1, NULL, NULL, 541125139, N'Good', N'A', N'1', N'10062014095737mirfan00.jpg', N'mirfan00.jpg', N'jpg', CAST(0x00009EEC00000000 AS DateTime), 5, 4, 1, N'A', N'A', 54126370459, 1, 2, 5412641111, CAST(0x0000A35400EC48DB AS DateTime), NULL)
INSERT [dbo].[es009000T0] ([student_id], [salutation_id], [applicant_id], [application_no], [student_no], [moe_no], [applied_course_id], [acyear_id], [stud_doj], [fee_com_subgrp_id], [apld_date], [ministry_list_stat], [house_id], [stud_code], [stud_fname], [stud_mname], [stud_sname], [pasprt_fname], [fname_native], [mname_native], [sname_native], [emrgncy_cntct_name], [emrgncy_cntct_phno], [nationality_id], [born_place], [born_country_id], [parent_emp_flag], [cat_req_flag], [hostel_req], [accomodation_type_id], [aftr_care_req_flag], [gender_id], [religion_id], [cast_id], [mother_tng_id], [stud_interests], [sponsor_id], [ethnicity_id], [remarks], [transport_req_flag], [primary_cntct_flag], [upld_date_file_name], [upld_org_file_name], [upld_file_extn], [stud_dob], [comp_id], [ba_id], [bl_id], [rec_status], [update_stat], [update_id], [update_seq], [crtd_by], [course_section_alloc_id], [dt_tm], [flag]) VALUES (54126370487, 3, 54126314242, N'AN-140531-2', N'5-4-1-25-1-4126370451', NULL, 541128133, 541128325, CAST(0x0000A33C00000000 AS DateTime), 541129942, NULL, NULL, 541263747, N'AC-140531-', N'Manu', N'M', NULL, NULL, N'Manu', N'M', NULL, NULL, NULL, 54112491, NULL, 10, N'I', N'I', N'I', NULL, N'I', 1, 1, 3, 1, NULL, NULL, 541125139, NULL, N'I', N'1', N'31052014101537mirfan00.jpg', N'mirfan00.jpg', N'jpg', CAST(0x00009EC600000000 AS DateTime), 5, 4, 1, N'A', N'A', 54126370451, 1, 2, 5412641112, CAST(0x0000A3540103FF55 AS DateTime), NULL)
INSERT [dbo].[es009000T0] ([student_id], [salutation_id], [applicant_id], [application_no], [student_no], [moe_no], [applied_course_id], [acyear_id], [stud_doj], [fee_com_subgrp_id], [apld_date], [ministry_list_stat], [house_id], [stud_code], [stud_fname], [stud_mname], [stud_sname], [pasprt_fname], [fname_native], [mname_native], [sname_native], [emrgncy_cntct_name], [emrgncy_cntct_phno], [nationality_id], [born_place], [born_country_id], [parent_emp_flag], [cat_req_flag], [hostel_req], [accomodation_type_id], [aftr_care_req_flag], [gender_id], [religion_id], [cast_id], [mother_tng_id], [stud_interests], [sponsor_id], [ethnicity_id], [remarks], [transport_req_flag], [primary_cntct_flag], [upld_date_file_name], [upld_org_file_name], [upld_file_extn], [stud_dob], [comp_id], [ba_id], [bl_id], [rec_status], [update_stat], [update_id], [update_seq], [crtd_by], [course_section_alloc_id], [dt_tm], [flag]) VALUES (54126370488, 3, 54126314243, N'AN-140531-3', N'5-4-1-25-1-4126370452', NULL, 541128133, 541128325, CAST(0x0000A33C00000000 AS DateTime), 541129942, NULL, NULL, 541263747, N'AC-140531-', N'David', NULL, N'Abraham', NULL, N'David', NULL, N'Abraham', NULL, NULL, 54112491, NULL, 10, N'I', N'I', N'A', NULL, N'I', 1, 3, 6, 1, NULL, NULL, 541125139, NULL, N'I', N'1', N'31052014105141Koala.jpg', N'Koala.jpg', N'jpg', CAST(0x00009F4100000000 AS DateTime), 5, 4, 1, N'A', N'U', 54126370452, 4, 2, 5412641111, CAST(0x0000A35401043282 AS DateTime), NULL)
INSERT [dbo].[es009000T0] ([student_id], [salutation_id], [applicant_id], [application_no], [student_no], [moe_no], [applied_course_id], [acyear_id], [stud_doj], [fee_com_subgrp_id], [apld_date], [ministry_list_stat], [house_id], [stud_code], [stud_fname], [stud_mname], [stud_sname], [pasprt_fname], [fname_native], [mname_native], [sname_native], [emrgncy_cntct_name], [emrgncy_cntct_phno], [nationality_id], [born_place], [born_country_id], [parent_emp_flag], [cat_req_flag], [hostel_req], [accomodation_type_id], [aftr_care_req_flag], [gender_id], [religion_id], [cast_id], [mother_tng_id], [stud_interests], [sponsor_id], [ethnicity_id], [remarks], [transport_req_flag], [primary_cntct_flag], [upld_date_file_name], [upld_org_file_name], [upld_file_extn], [stud_dob], [comp_id], [ba_id], [bl_id], [rec_status], [update_stat], [update_id], [update_seq], [crtd_by], [course_section_alloc_id], [dt_tm], [flag]) VALUES (54126370489, 3, 54126314251, N'AN-140616-2', N'5-4-1-25-1-4126370467', NULL, 541128139, 541128325, CAST(0x0000A34C00000000 AS DateTime), 541129942, NULL, NULL, 541263747, N'AC-140616-', N'Mohan', NULL, N'John', NULL, N'Mohan', NULL, N'John', NULL, NULL, 54112491, NULL, 10, N'I', N'I', N'I', NULL, N'I', 1, 1, 3, 1, NULL, NULL, 541125139, NULL, N'I', N'1', N'16062014105503Optimized-my_passport_photo.jpg', N'Optimized-my_passport_photo.jpg', N'jpg', CAST(0x00009F0E00000000 AS DateTime), 5, 4, 1, N'A', N'U', 54126370467, 5, 2, 5412641151, CAST(0x0000A35401049D4A AS DateTime), NULL)
INSERT [dbo].[es009000T0] ([student_id], [salutation_id], [applicant_id], [application_no], [student_no], [moe_no], [applied_course_id], [acyear_id], [stud_doj], [fee_com_subgrp_id], [apld_date], [ministry_list_stat], [house_id], [stud_code], [stud_fname], [stud_mname], [stud_sname], [pasprt_fname], [fname_native], [mname_native], [sname_native], [emrgncy_cntct_name], [emrgncy_cntct_phno], [nationality_id], [born_place], [born_country_id], [parent_emp_flag], [cat_req_flag], [hostel_req], [accomodation_type_id], [aftr_care_req_flag], [gender_id], [religion_id], [cast_id], [mother_tng_id], [stud_interests], [sponsor_id], [ethnicity_id], [remarks], [transport_req_flag], [primary_cntct_flag], [upld_date_file_name], [upld_org_file_name], [upld_file_extn], [stud_dob], [comp_id], [ba_id], [bl_id], [rec_status], [update_stat], [update_id], [update_seq], [crtd_by], [course_section_alloc_id], [dt_tm], [flag]) VALUES (54126370490, 3, 54126314243, N'AN-140531-3', N'5-4-1-25-1-4126370452', NULL, 541128133, 541128325, CAST(0x0000A33C00000000 AS DateTime), 541129942, NULL, NULL, 541263747, N'AC-140531-', N'David', NULL, N'Rahul', NULL, N'David', NULL, N'Abraham', NULL, NULL, 54112491, NULL, 10, N'I', N'I', N'A', NULL, N'I', 1, 3, 6, 1, NULL, NULL, 541125139, NULL, N'I', N'1', N'31052014105141Koala.jpg', N'Koala.jpg', N'jpg', CAST(0x00009F4100000000 AS DateTime), 5, 4, 1, N'A', N'A', 54126370452, 1, 2, 5412641111, CAST(0x0000A3540108B463 AS DateTime), NULL)
INSERT [dbo].[es009000T0] ([student_id], [salutation_id], [applicant_id], [application_no], [student_no], [moe_no], [applied_course_id], [acyear_id], [stud_doj], [fee_com_subgrp_id], [apld_date], [ministry_list_stat], [house_id], [stud_code], [stud_fname], [stud_mname], [stud_sname], [pasprt_fname], [fname_native], [mname_native], [sname_native], [emrgncy_cntct_name], [emrgncy_cntct_phno], [nationality_id], [born_place], [born_country_id], [parent_emp_flag], [cat_req_flag], [hostel_req], [accomodation_type_id], [aftr_care_req_flag], [gender_id], [religion_id], [cast_id], [mother_tng_id], [stud_interests], [sponsor_id], [ethnicity_id], [remarks], [transport_req_flag], [primary_cntct_flag], [upld_date_file_name], [upld_org_file_name], [upld_file_extn], [stud_dob], [comp_id], [ba_id], [bl_id], [rec_status], [update_stat], [update_id], [update_seq], [crtd_by], [course_section_alloc_id], [dt_tm], [flag]) VALUES (54126370491, 3, 54126314251, N'AN-140616-2', N'5-4-1-25-1-4126370467', NULL, 541128139, 541128325, CAST(0x0000A34C00000000 AS DateTime), 541129942, NULL, NULL, 541263747, N'AC-140616-', N'Mohan', NULL, N'John', NULL, N'Mohan', NULL, N'Johnjhkh', NULL, NULL, 54112491, NULL, 10, N'I', N'I', N'I', NULL, N'I', 1, 1, 3, 1, NULL, NULL, 541125139, NULL, N'I', N'1', N'16062014105503Optimized-my_passport_photo.jpg', N'Optimized-my_passport_photo.jpg', N'jpg', CAST(0x00009F0E00000000 AS DateTime), 5, 4, 1, N'A', N'A', 54126370467, 1, 2, 5412641151, CAST(0x0000A35500F245AD AS DateTime), NULL)
INSERT [dbo].[es009000T0] ([student_id], [salutation_id], [applicant_id], [application_no], [student_no], [moe_no], [applied_course_id], [acyear_id], [stud_doj], [fee_com_subgrp_id], [apld_date], [ministry_list_stat], [house_id], [stud_code], [stud_fname], [stud_mname], [stud_sname], [pasprt_fname], [fname_native], [mname_native], [sname_native], [emrgncy_cntct_name], [emrgncy_cntct_phno], [nationality_id], [born_place], [born_country_id], [parent_emp_flag], [cat_req_flag], [hostel_req], [accomodation_type_id], [aftr_care_req_flag], [gender_id], [religion_id], [cast_id], [mother_tng_id], [stud_interests], [sponsor_id], [ethnicity_id], [remarks], [transport_req_flag], [primary_cntct_flag], [upld_date_file_name], [upld_org_file_name], [upld_file_extn], [stud_dob], [comp_id], [ba_id], [bl_id], [rec_status], [update_stat], [update_id], [update_seq], [crtd_by], [course_section_alloc_id], [dt_tm], [flag]) VALUES (54126370492, 38, 54126314247, N'AN-140609-1', N'5-4-1-25-2-4126370457', NULL, 541128144, 541128325, CAST(0x0000A34200000000 AS DateTime), 541129942, NULL, NULL, NULL, N'AC-140609-', N'Tinsha', NULL, N'Thomas', NULL, N'Tinsha', NULL, N'Thomas', NULL, NULL, 54112491, NULL, 10, N'I', N'I', N'I', NULL, N'I', 2, 3, 2, 1, NULL, NULL, 541125139, NULL, N'I', N'1', N'69201443912PMMy_Passport_size_Single_Photo.jpg', N'My_Passport_size_Single_Photo.jpg', N'jpg', CAST(0x0000950800000000 AS DateTime), 5, 4, 1, N'A', N'A', 54126370457, 1, 2, 5412641144, CAST(0x0000A3550101A10C AS DateTime), NULL)
INSERT [dbo].[es009000T0] ([student_id], [salutation_id], [applicant_id], [application_no], [student_no], [moe_no], [applied_course_id], [acyear_id], [stud_doj], [fee_com_subgrp_id], [apld_date], [ministry_list_stat], [house_id], [stud_code], [stud_fname], [stud_mname], [stud_sname], [pasprt_fname], [fname_native], [mname_native], [sname_native], [emrgncy_cntct_name], [emrgncy_cntct_phno], [nationality_id], [born_place], [born_country_id], [parent_emp_flag], [cat_req_flag], [hostel_req], [accomodation_type_id], [aftr_care_req_flag], [gender_id], [religion_id], [cast_id], [mother_tng_id], [stud_interests], [sponsor_id], [ethnicity_id], [remarks], [transport_req_flag], [primary_cntct_flag], [upld_date_file_name], [upld_org_file_name], [upld_file_extn], [stud_dob], [comp_id], [ba_id], [bl_id], [rec_status], [update_stat], [update_id], [update_seq], [crtd_by], [course_section_alloc_id], [dt_tm], [flag]) VALUES (54126370493, 3, 54126314252, N'AN-140619-1', N'5-4-1-25-1-4126370474', NULL, 541128133, 541128325, CAST(0x0000A34F00000000 AS DateTime), 541129942, NULL, NULL, NULL, N'Ac-140619-', N'David', NULL, N'Villa', NULL, N'David', NULL, N'Villa', NULL, NULL, 54112491, NULL, 10, N'I', N'I', N'I', NULL, N'I', 1, 1, 3, 1, NULL, NULL, 541125139, NULL, N'I', N'1', N'19062014174313Koala.jpg', N'Koala.jpg', N'jpg', CAST(0x0000995000000000 AS DateTime), 5, 4, 1, N'I', N'U', 54126370474, 6, 2, 5412641111, CAST(0x0000A35600A6B215 AS DateTime), NULL)
INSERT [dbo].[es009000T0] ([student_id], [salutation_id], [applicant_id], [application_no], [student_no], [moe_no], [applied_course_id], [acyear_id], [stud_doj], [fee_com_subgrp_id], [apld_date], [ministry_list_stat], [house_id], [stud_code], [stud_fname], [stud_mname], [stud_sname], [pasprt_fname], [fname_native], [mname_native], [sname_native], [emrgncy_cntct_name], [emrgncy_cntct_phno], [nationality_id], [born_place], [born_country_id], [parent_emp_flag], [cat_req_flag], [hostel_req], [accomodation_type_id], [aftr_care_req_flag], [gender_id], [religion_id], [cast_id], [mother_tng_id], [stud_interests], [sponsor_id], [ethnicity_id], [remarks], [transport_req_flag], [primary_cntct_flag], [upld_date_file_name], [upld_org_file_name], [upld_file_extn], [stud_dob], [comp_id], [ba_id], [bl_id], [rec_status], [update_stat], [update_id], [update_seq], [crtd_by], [course_section_alloc_id], [dt_tm], [flag]) VALUES (54126370494, 3, 54126314252, N'AN-140619-1', N'5-4-1-25-1-4126370474', NULL, 541128133, 541128325, CAST(0x0000A34F00000000 AS DateTime), 541129942, NULL, NULL, NULL, N'Ac-140619-', N'David', NULL, N'Villa', NULL, N'David', NULL, N'Villa', NULL, NULL, 54112491, NULL, 10, N'I', N'I', N'I', NULL, N'I', 1, 1, 3, 1, NULL, NULL, 541125139, NULL, N'I', N'1', N'19062014174313Koala.jpg', N'Koala.jpg', N'jpg', CAST(0x0000995000000000 AS DateTime), 5, 4, 1, N'A', N'U', 54126370474, 6, 2, 5412641111, CAST(0x0000A35600A6BEF9 AS DateTime), NULL)
INSERT [dbo].[es009000T0] ([student_id], [salutation_id], [applicant_id], [application_no], [student_no], [moe_no], [applied_course_id], [acyear_id], [stud_doj], [fee_com_subgrp_id], [apld_date], [ministry_list_stat], [house_id], [stud_code], [stud_fname], [stud_mname], [stud_sname], [pasprt_fname], [fname_native], [mname_native], [sname_native], [emrgncy_cntct_name], [emrgncy_cntct_phno], [nationality_id], [born_place], [born_country_id], [parent_emp_flag], [cat_req_flag], [hostel_req], [accomodation_type_id], [aftr_care_req_flag], [gender_id], [religion_id], [cast_id], [mother_tng_id], [stud_interests], [sponsor_id], [ethnicity_id], [remarks], [transport_req_flag], [primary_cntct_flag], [upld_date_file_name], [upld_org_file_name], [upld_file_extn], [stud_dob], [comp_id], [ba_id], [bl_id], [rec_status], [update_stat], [update_id], [update_seq], [crtd_by], [course_section_alloc_id], [dt_tm], [flag]) VALUES (54126370495, 3, 54126314252, N'AN-140619-1', N'5-4-1-25-1-4126370474', NULL, 541128133, 541128325, CAST(0x0000A34F00000000 AS DateTime), 541129942, NULL, NULL, NULL, N'Ac-140619-', N'David', NULL, N'Villa', NULL, N'David', NULL, N'Villa', NULL, NULL, 54112491, NULL, 10, N'I', N'I', N'I', NULL, N'I', 1, 1, 3, 1, NULL, NULL, 541125139, NULL, N'I', N'1', N'19062014174313Koala.jpg', N'Koala.jpg', N'jpg', CAST(0x0000995000000000 AS DateTime), 5, 4, 1, N'I', N'U', 54126370474, 6, 2, 5412641111, CAST(0x0000A35600A6F1E7 AS DateTime), NULL)
INSERT [dbo].[es009000T0] ([student_id], [salutation_id], [applicant_id], [application_no], [student_no], [moe_no], [applied_course_id], [acyear_id], [stud_doj], [fee_com_subgrp_id], [apld_date], [ministry_list_stat], [house_id], [stud_code], [stud_fname], [stud_mname], [stud_sname], [pasprt_fname], [fname_native], [mname_native], [sname_native], [emrgncy_cntct_name], [emrgncy_cntct_phno], [nationality_id], [born_place], [born_country_id], [parent_emp_flag], [cat_req_flag], [hostel_req], [accomodation_type_id], [aftr_care_req_flag], [gender_id], [religion_id], [cast_id], [mother_tng_id], [stud_interests], [sponsor_id], [ethnicity_id], [remarks], [transport_req_flag], [primary_cntct_flag], [upld_date_file_name], [upld_org_file_name], [upld_file_extn], [stud_dob], [comp_id], [ba_id], [bl_id], [rec_status], [update_stat], [update_id], [update_seq], [crtd_by], [course_section_alloc_id], [dt_tm], [flag]) VALUES (54126370496, 3, 54126314252, N'AN-140619-1', N'5-4-1-25-1-4126370474', NULL, 541128133, 541128325, CAST(0x0000A34F00000000 AS DateTime), 541129942, NULL, NULL, NULL, N'Ac-140619-', N'David', NULL, N'Villa', NULL, N'David', NULL, N'Villa', NULL, NULL, 54112491, NULL, 10, N'I', N'I', N'I', NULL, N'I', 1, 1, 3, 1, NULL, NULL, 541125139, NULL, N'I', N'1', N'19062014174313Koala.jpg', N'Koala.jpg', N'jpg', CAST(0x0000995000000000 AS DateTime), 5, 4, 1, N'A', N'U', 54126370474, 6, 2, 5412641111, CAST(0x0000A35600AB1135 AS DateTime), N'W')
INSERT [dbo].[es009000T0] ([student_id], [salutation_id], [applicant_id], [application_no], [student_no], [moe_no], [applied_course_id], [acyear_id], [stud_doj], [fee_com_subgrp_id], [apld_date], [ministry_list_stat], [house_id], [stud_code], [stud_fname], [stud_mname], [stud_sname], [pasprt_fname], [fname_native], [mname_native], [sname_native], [emrgncy_cntct_name], [emrgncy_cntct_phno], [nationality_id], [born_place], [born_country_id], [parent_emp_flag], [cat_req_flag], [hostel_req], [accomodation_type_id], [aftr_care_req_flag], [gender_id], [religion_id], [cast_id], [mother_tng_id], [stud_interests], [sponsor_id], [ethnicity_id], [remarks], [transport_req_flag], [primary_cntct_flag], [upld_date_file_name], [upld_org_file_name], [upld_file_extn], [stud_dob], [comp_id], [ba_id], [bl_id], [rec_status], [update_stat], [update_id], [update_seq], [crtd_by], [course_section_alloc_id], [dt_tm], [flag]) VALUES (54126370497, 3, 54126314252, N'AN-140619-1', N'5-4-1-25-1-4126370474', NULL, 541128133, 541128325, CAST(0x0000A34F00000000 AS DateTime), NULL, NULL, NULL, NULL, N'Ac-140619-', N'David', NULL, N'Villa', NULL, N'David', NULL, N'Villa', NULL, NULL, 54112491, NULL, 10, N'I', N'I', N'I', NULL, N'I', 1, 1, 3, 1, NULL, NULL, 541125139, NULL, N'I', N'1', N'19062014174313Koala.jpg', N'Koala.jpg', N'jpg', CAST(0x0000995000000000 AS DateTime), 5, 4, 1, N'A', N'A', 54126370474, 1, 2, 5412641111, CAST(0x0000A35600F7285F AS DateTime), N'S')
/****** Object:  Table [dbo].[es096001T0]    Script Date: 06/27/2014 10:25:47 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[es096001T0](
	[stud_assmnt_id] [bigint] NOT NULL,
	[student_id] [bigint] NOT NULL,
	[med_date] [datetime] NOT NULL,
	[med_gen_id] [bigint] NULL,
	[diag_detail_id] [bigint] NULL,
	[read_date] [datetime] NOT NULL,
	[status_id] [bigint] NOT NULL,
	[followup_date] [datetime] NOT NULL,
	[rec_status] [varchar](1) NOT NULL,
	[comp_id] [bigint] NOT NULL,
	[ba_id] [bigint] NOT NULL,
	[bl_id] [bigint] NOT NULL,
	[crtd_by] [bigint] NOT NULL,
	[dt_tm] [datetime] NOT NULL,
 CONSTRAINT [PK_es096001T0] PRIMARY KEY CLUSTERED 
(
	[stud_assmnt_id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
INSERT [dbo].[es096001T0] ([stud_assmnt_id], [student_id], [med_date], [med_gen_id], [diag_detail_id], [read_date], [status_id], [followup_date], [rec_status], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm]) VALUES (5412654067, 54126370451, CAST(0x0000A33C00000000 AS DateTime), 541265371, NULL, CAST(0x0000A33C00000000 AS DateTime), 1, CAST(0x0000A33C00000000 AS DateTime), N'A', 5, 4, 1, 2, CAST(0x0000A33C00B8C5D8 AS DateTime))
INSERT [dbo].[es096001T0] ([stud_assmnt_id], [student_id], [med_date], [med_gen_id], [diag_detail_id], [read_date], [status_id], [followup_date], [rec_status], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm]) VALUES (5412654068, 54126370451, CAST(0x0000A33C00000000 AS DateTime), 541265372, NULL, CAST(0x0000A33C00000000 AS DateTime), 1, CAST(0x0000A33C00000000 AS DateTime), N'A', 5, 4, 1, 2, CAST(0x0000A33C00B8C5D8 AS DateTime))
INSERT [dbo].[es096001T0] ([stud_assmnt_id], [student_id], [med_date], [med_gen_id], [diag_detail_id], [read_date], [status_id], [followup_date], [rec_status], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm]) VALUES (5412654069, 54126370451, CAST(0x0000A33C00000000 AS DateTime), 541265373, NULL, CAST(0x0000A33C00000000 AS DateTime), 1, CAST(0x0000A33C00000000 AS DateTime), N'A', 5, 4, 1, 2, CAST(0x0000A33C00B8C5D8 AS DateTime))
INSERT [dbo].[es096001T0] ([stud_assmnt_id], [student_id], [med_date], [med_gen_id], [diag_detail_id], [read_date], [status_id], [followup_date], [rec_status], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm]) VALUES (5412654070, 54126370451, CAST(0x0000A33C00000000 AS DateTime), NULL, 3, CAST(0x0000A33C00000000 AS DateTime), 1, CAST(0x0000A33C00000000 AS DateTime), N'A', 5, 4, 1, 2, CAST(0x0000A33C00B8C5DB AS DateTime))
INSERT [dbo].[es096001T0] ([stud_assmnt_id], [student_id], [med_date], [med_gen_id], [diag_detail_id], [read_date], [status_id], [followup_date], [rec_status], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm]) VALUES (5412654071, 54126370451, CAST(0x0000A33C00000000 AS DateTime), NULL, 5412637758, CAST(0x0000A33C00000000 AS DateTime), 1, CAST(0x0000A33C00000000 AS DateTime), N'A', 5, 4, 1, 2, CAST(0x0000A33C00B8C5DB AS DateTime))
INSERT [dbo].[es096001T0] ([stud_assmnt_id], [student_id], [med_date], [med_gen_id], [diag_detail_id], [read_date], [status_id], [followup_date], [rec_status], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm]) VALUES (5412654083, 54126370462, CAST(0x0000A34D00000000 AS DateTime), 541265371, NULL, CAST(0x0000A34D00000000 AS DateTime), 1, CAST(0x0000A34D00000000 AS DateTime), N'I', 5, 4, 1, 2, CAST(0x0000A34D00A450E3 AS DateTime))
INSERT [dbo].[es096001T0] ([stud_assmnt_id], [student_id], [med_date], [med_gen_id], [diag_detail_id], [read_date], [status_id], [followup_date], [rec_status], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm]) VALUES (5412654084, 54126370462, CAST(0x0000A34D00000000 AS DateTime), 541265372, NULL, CAST(0x0000000000000000 AS DateTime), 0, CAST(0x0000000000000000 AS DateTime), N'I', 5, 4, 1, 2, CAST(0x0000A34D00A450E4 AS DateTime))
INSERT [dbo].[es096001T0] ([stud_assmnt_id], [student_id], [med_date], [med_gen_id], [diag_detail_id], [read_date], [status_id], [followup_date], [rec_status], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm]) VALUES (5412654085, 54126370462, CAST(0x0000A34D00000000 AS DateTime), 541265373, NULL, CAST(0x0000000000000000 AS DateTime), 0, CAST(0x0000000000000000 AS DateTime), N'I', 5, 4, 1, 2, CAST(0x0000A34D00A450E4 AS DateTime))
INSERT [dbo].[es096001T0] ([stud_assmnt_id], [student_id], [med_date], [med_gen_id], [diag_detail_id], [read_date], [status_id], [followup_date], [rec_status], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm]) VALUES (5412654086, 54126370462, CAST(0x0000A34D00000000 AS DateTime), NULL, 5412637751, CAST(0x0000A34D00000000 AS DateTime), 1, CAST(0x0000A34D00000000 AS DateTime), N'A', 5, 4, 1, 2, CAST(0x0000A34D00A450E5 AS DateTime))
INSERT [dbo].[es096001T0] ([stud_assmnt_id], [student_id], [med_date], [med_gen_id], [diag_detail_id], [read_date], [status_id], [followup_date], [rec_status], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm]) VALUES (5412654087, 54126370462, CAST(0x0000A34D00000000 AS DateTime), NULL, 5412637748, CAST(0x0000A34D00000000 AS DateTime), 4, CAST(0x0000A34D00000000 AS DateTime), N'A', 5, 4, 1, 2, CAST(0x0000A34D00A450E5 AS DateTime))
INSERT [dbo].[es096001T0] ([stud_assmnt_id], [student_id], [med_date], [med_gen_id], [diag_detail_id], [read_date], [status_id], [followup_date], [rec_status], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm]) VALUES (5412654088, 54126370451, CAST(0x0000A34D00000000 AS DateTime), 541265371, NULL, CAST(0x0000A34D00000000 AS DateTime), 1, CAST(0x0000A34F00000000 AS DateTime), N'A', 5, 4, 1, 2, CAST(0x0000A34D00EB81E6 AS DateTime))
INSERT [dbo].[es096001T0] ([stud_assmnt_id], [student_id], [med_date], [med_gen_id], [diag_detail_id], [read_date], [status_id], [followup_date], [rec_status], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm]) VALUES (5412654089, 54126370451, CAST(0x0000A34D00000000 AS DateTime), 541265372, NULL, CAST(0x0000000000000000 AS DateTime), 0, CAST(0x0000000000000000 AS DateTime), N'I', 5, 4, 1, 2, CAST(0x0000A34D00EB81E7 AS DateTime))
INSERT [dbo].[es096001T0] ([stud_assmnt_id], [student_id], [med_date], [med_gen_id], [diag_detail_id], [read_date], [status_id], [followup_date], [rec_status], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm]) VALUES (5412654090, 54126370451, CAST(0x0000A34D00000000 AS DateTime), 541265373, NULL, CAST(0x0000000000000000 AS DateTime), 0, CAST(0x0000000000000000 AS DateTime), N'I', 5, 4, 1, 2, CAST(0x0000A34D00EB81E7 AS DateTime))
INSERT [dbo].[es096001T0] ([stud_assmnt_id], [student_id], [med_date], [med_gen_id], [diag_detail_id], [read_date], [status_id], [followup_date], [rec_status], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm]) VALUES (5412654091, 54126370451, CAST(0x0000A34D00000000 AS DateTime), NULL, 3, CAST(0x0000A34D00000000 AS DateTime), 1, CAST(0x0000A34F00000000 AS DateTime), N'A', 5, 4, 1, 2, CAST(0x0000A34D00EB81E8 AS DateTime))
INSERT [dbo].[es096001T0] ([stud_assmnt_id], [student_id], [med_date], [med_gen_id], [diag_detail_id], [read_date], [status_id], [followup_date], [rec_status], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm]) VALUES (5412654092, 54126370451, CAST(0x0000A34D00000000 AS DateTime), NULL, 5412637752, CAST(0x0000A34D00000000 AS DateTime), 1, CAST(0x0000A34D00000000 AS DateTime), N'A', 5, 4, 1, 2, CAST(0x0000A34D00EB81E9 AS DateTime))
INSERT [dbo].[es096001T0] ([stud_assmnt_id], [student_id], [med_date], [med_gen_id], [diag_detail_id], [read_date], [status_id], [followup_date], [rec_status], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm]) VALUES (54126540100, 54126370458, CAST(0x0000A34D00000000 AS DateTime), 541265371, NULL, CAST(0x0000A34D00000000 AS DateTime), 1, CAST(0x0000A34D00000000 AS DateTime), N'A', 5, 4, 1, 2, CAST(0x0000A35400BAA2E3 AS DateTime))
INSERT [dbo].[es096001T0] ([stud_assmnt_id], [student_id], [med_date], [med_gen_id], [diag_detail_id], [read_date], [status_id], [followup_date], [rec_status], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm]) VALUES (54126540101, 54126370458, CAST(0x0000A34D00000000 AS DateTime), 541265372, NULL, CAST(0x0000000000000000 AS DateTime), 0, CAST(0x0000000000000000 AS DateTime), N'I', 5, 4, 1, 2, CAST(0x0000A35400BAA2E3 AS DateTime))
INSERT [dbo].[es096001T0] ([stud_assmnt_id], [student_id], [med_date], [med_gen_id], [diag_detail_id], [read_date], [status_id], [followup_date], [rec_status], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm]) VALUES (54126540102, 54126370458, CAST(0x0000A34D00000000 AS DateTime), 541265373, NULL, CAST(0x0000000000000000 AS DateTime), 0, CAST(0x0000000000000000 AS DateTime), N'I', 5, 4, 1, 2, CAST(0x0000A35400BAA2E4 AS DateTime))
INSERT [dbo].[es096001T0] ([stud_assmnt_id], [student_id], [med_date], [med_gen_id], [diag_detail_id], [read_date], [status_id], [followup_date], [rec_status], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm]) VALUES (54126540103, 54126370458, CAST(0x0000A34D00000000 AS DateTime), NULL, 3, CAST(0x0000A34D00000000 AS DateTime), 4, CAST(0x0000A34F00000000 AS DateTime), N'A', 5, 4, 1, 2, CAST(0x0000A35400BAA2E4 AS DateTime))
INSERT [dbo].[es096001T0] ([stud_assmnt_id], [student_id], [med_date], [med_gen_id], [diag_detail_id], [read_date], [status_id], [followup_date], [rec_status], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm]) VALUES (54126540104, 54126370458, CAST(0x0000A34D00000000 AS DateTime), NULL, 5412637738, CAST(0x0000A34D00000000 AS DateTime), 2, CAST(0x0000A34F00000000 AS DateTime), N'A', 5, 4, 1, 2, CAST(0x0000A35400BAA2E4 AS DateTime))
INSERT [dbo].[es096001T0] ([stud_assmnt_id], [student_id], [med_date], [med_gen_id], [diag_detail_id], [read_date], [status_id], [followup_date], [rec_status], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm]) VALUES (54126540105, 54126370458, CAST(0x0000A34D00000000 AS DateTime), NULL, 5412637722, CAST(0x0000A34D00000000 AS DateTime), 1, CAST(0x0000A34F00000000 AS DateTime), N'A', 5, 4, 1, 2, CAST(0x0000A35400BAA2E5 AS DateTime))
INSERT [dbo].[es096001T0] ([stud_assmnt_id], [student_id], [med_date], [med_gen_id], [diag_detail_id], [read_date], [status_id], [followup_date], [rec_status], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm]) VALUES (54126540106, 54126370458, CAST(0x0000A34D00000000 AS DateTime), NULL, 5412637752, CAST(0x0000A34D00000000 AS DateTime), 3, CAST(0x0000A34F00000000 AS DateTime), N'A', 5, 4, 1, 2, CAST(0x0000A35400BAA2E5 AS DateTime))
INSERT [dbo].[es096001T0] ([stud_assmnt_id], [student_id], [med_date], [med_gen_id], [diag_detail_id], [read_date], [status_id], [followup_date], [rec_status], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm]) VALUES (54126540116, 54126370462, CAST(0x0000A35400000000 AS DateTime), 541265371, NULL, CAST(0x0000A35400000000 AS DateTime), 1, CAST(0x0000A35400000000 AS DateTime), N'A', 5, 4, 1, 2, CAST(0x0000A35600C6338C AS DateTime))
INSERT [dbo].[es096001T0] ([stud_assmnt_id], [student_id], [med_date], [med_gen_id], [diag_detail_id], [read_date], [status_id], [followup_date], [rec_status], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm]) VALUES (54126540117, 54126370462, CAST(0x0000A35400000000 AS DateTime), 541265372, NULL, CAST(0x0000A35400000000 AS DateTime), 1, CAST(0x0000A35400000000 AS DateTime), N'A', 5, 4, 1, 2, CAST(0x0000A35600C6338D AS DateTime))
INSERT [dbo].[es096001T0] ([stud_assmnt_id], [student_id], [med_date], [med_gen_id], [diag_detail_id], [read_date], [status_id], [followup_date], [rec_status], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm]) VALUES (54126540118, 54126370462, CAST(0x0000A35400000000 AS DateTime), 541265373, NULL, CAST(0x0000A35400000000 AS DateTime), 1, CAST(0x0000A35400000000 AS DateTime), N'A', 5, 4, 1, 2, CAST(0x0000A35600C6338D AS DateTime))
INSERT [dbo].[es096001T0] ([stud_assmnt_id], [student_id], [med_date], [med_gen_id], [diag_detail_id], [read_date], [status_id], [followup_date], [rec_status], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm]) VALUES (54126540119, 54126370462, CAST(0x0000A35400000000 AS DateTime), NULL, 3, CAST(0x0000A35400000000 AS DateTime), 1, CAST(0x0000A35400000000 AS DateTime), N'A', 5, 4, 1, 2, CAST(0x0000A35600C6338E AS DateTime))
INSERT [dbo].[es096001T0] ([stud_assmnt_id], [student_id], [med_date], [med_gen_id], [diag_detail_id], [read_date], [status_id], [followup_date], [rec_status], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm]) VALUES (54126540120, 54126370462, CAST(0x0000A35400000000 AS DateTime), NULL, 5412637722, CAST(0x0000A35600000000 AS DateTime), 1, CAST(0x0000A35600000000 AS DateTime), N'A', 5, 4, 1, 2, CAST(0x0000A35600C6338E AS DateTime))
INSERT [dbo].[es096001T0] ([stud_assmnt_id], [student_id], [med_date], [med_gen_id], [diag_detail_id], [read_date], [status_id], [followup_date], [rec_status], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm]) VALUES (54126540127, 54126370476, CAST(0x0000A35400000000 AS DateTime), 541265371, NULL, CAST(0x0000A35400000000 AS DateTime), 1, CAST(0x0000A35400000000 AS DateTime), N'A', 5, 4, 1, 2, CAST(0x0000A35601262769 AS DateTime))
INSERT [dbo].[es096001T0] ([stud_assmnt_id], [student_id], [med_date], [med_gen_id], [diag_detail_id], [read_date], [status_id], [followup_date], [rec_status], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm]) VALUES (54126540128, 54126370476, CAST(0x0000A35400000000 AS DateTime), 541265372, NULL, CAST(0x0000000000000000 AS DateTime), 0, CAST(0x0000000000000000 AS DateTime), N'I', 5, 4, 1, 2, CAST(0x0000A3560126276A AS DateTime))
INSERT [dbo].[es096001T0] ([stud_assmnt_id], [student_id], [med_date], [med_gen_id], [diag_detail_id], [read_date], [status_id], [followup_date], [rec_status], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm]) VALUES (54126540129, 54126370476, CAST(0x0000A35400000000 AS DateTime), 541265373, NULL, CAST(0x0000000000000000 AS DateTime), 0, CAST(0x0000000000000000 AS DateTime), N'I', 5, 4, 1, 2, CAST(0x0000A3560126276A AS DateTime))
INSERT [dbo].[es096001T0] ([stud_assmnt_id], [student_id], [med_date], [med_gen_id], [diag_detail_id], [read_date], [status_id], [followup_date], [rec_status], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm]) VALUES (54126540130, 54126370476, CAST(0x0000A35400000000 AS DateTime), NULL, 5412637735, CAST(0x0000A35400000000 AS DateTime), 1, CAST(0x0000A35400000000 AS DateTime), N'A', 5, 4, 1, 2, CAST(0x0000A3560126276B AS DateTime))
INSERT [dbo].[es096001T0] ([stud_assmnt_id], [student_id], [med_date], [med_gen_id], [diag_detail_id], [read_date], [status_id], [followup_date], [rec_status], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm]) VALUES (54126540131, 54126370476, CAST(0x0000A35400000000 AS DateTime), NULL, 5412637756, CAST(0x0000A35400000000 AS DateTime), 1, CAST(0x0000A35400000000 AS DateTime), N'A', 5, 4, 1, 2, CAST(0x0000A3560126276B AS DateTime))
INSERT [dbo].[es096001T0] ([stud_assmnt_id], [student_id], [med_date], [med_gen_id], [diag_detail_id], [read_date], [status_id], [followup_date], [rec_status], [comp_id], [ba_id], [bl_id], [crtd_by], [dt_tm]) VALUES (54126540132, 54126370476, CAST(0x0000A35400000000 AS DateTime), NULL, 5412637761, CAST(0x0000A35600000000 AS DateTime), 1, CAST(0x0000A35600000000 AS DateTime), N'I', 5, 4, 1, 2, CAST(0x0000A3560126276B AS DateTime))
/****** Object:  Default [DF_es007100T0_update_stat]    Script Date: 06/27/2014 10:25:47 ******/
ALTER TABLE [dbo].[es007100T0] ADD  CONSTRAINT [DF_es007100T0_update_stat]  DEFAULT ('A') FOR [update_stat]
GO
/****** Object:  Default [DF_es007100T0_update_seq]    Script Date: 06/27/2014 10:25:47 ******/
ALTER TABLE [dbo].[es007100T0] ADD  CONSTRAINT [DF_es007100T0_update_seq]  DEFAULT ((1)) FOR [update_seq]
GO
/****** Object:  Default [DF_es009000T0_update_stat]    Script Date: 06/27/2014 10:25:47 ******/
ALTER TABLE [dbo].[es009000T0] ADD  CONSTRAINT [DF_es009000T0_update_stat]  DEFAULT ('A') FOR [update_stat]
GO
/****** Object:  Default [DF_es009000T0_update_seq]    Script Date: 06/27/2014 10:25:47 ******/
ALTER TABLE [dbo].[es009000T0] ADD  CONSTRAINT [DF_es009000T0_update_seq]  DEFAULT ((1)) FOR [update_seq]
GO
/****** Object:  Default [DF_es100200T0_update_stat]    Script Date: 06/27/2014 10:25:47 ******/
ALTER TABLE [dbo].[es100200T0] ADD  CONSTRAINT [DF_es100200T0_update_stat]  DEFAULT ('A') FOR [update_stat]
GO
/****** Object:  Default [DF_es100200T0_update_seq]    Script Date: 06/27/2014 10:25:47 ******/
ALTER TABLE [dbo].[es100200T0] ADD  CONSTRAINT [DF_es100200T0_update_seq]  DEFAULT ((1)) FOR [update_seq]
GO
/****** Object:  ForeignKey [FK_es009000T0_es001300T0]    Script Date: 06/27/2014 10:25:47 ******/
ALTER TABLE [dbo].[es009000T0]  WITH CHECK ADD  CONSTRAINT [FK_es009000T0_es001300T0] FOREIGN KEY([applied_course_id])
REFERENCES [dbo].[es001300T0] ([course_id])
GO
ALTER TABLE [dbo].[es009000T0] CHECK CONSTRAINT [FK_es009000T0_es001300T0]
GO
/****** Object:  ForeignKey [FK_es009000T0_es002300T0]    Script Date: 06/27/2014 10:25:47 ******/
ALTER TABLE [dbo].[es009000T0]  WITH CHECK ADD  CONSTRAINT [FK_es009000T0_es002300T0] FOREIGN KEY([acyear_id])
REFERENCES [dbo].[es002300T0] ([acyear_id])
GO
ALTER TABLE [dbo].[es009000T0] CHECK CONSTRAINT [FK_es009000T0_es002300T0]
GO
/****** Object:  ForeignKey [FK_es009000T0_es009000T0]    Script Date: 06/27/2014 10:25:47 ******/
ALTER TABLE [dbo].[es009000T0]  WITH CHECK ADD  CONSTRAINT [FK_es009000T0_es009000T0] FOREIGN KEY([student_id])
REFERENCES [dbo].[es009000T0] ([student_id])
GO
ALTER TABLE [dbo].[es009000T0] CHECK CONSTRAINT [FK_es009000T0_es009000T0]
GO
/****** Object:  ForeignKey [FK_es009000T0_es009300T0]    Script Date: 06/27/2014 10:25:47 ******/
ALTER TABLE [dbo].[es009000T0]  WITH CHECK ADD  CONSTRAINT [FK_es009000T0_es009300T0] FOREIGN KEY([house_id])
REFERENCES [dbo].[es009300T0] ([house_id])
GO
ALTER TABLE [dbo].[es009000T0] CHECK CONSTRAINT [FK_es009000T0_es009300T0]
GO
/****** Object:  ForeignKey [FK_es009000T0_es012000T0]    Script Date: 06/27/2014 10:25:47 ******/
ALTER TABLE [dbo].[es009000T0]  WITH CHECK ADD  CONSTRAINT [FK_es009000T0_es012000T0] FOREIGN KEY([course_section_alloc_id])
REFERENCES [dbo].[es012000T0] ([course_section_alloc_id])
GO
ALTER TABLE [dbo].[es009000T0] CHECK CONSTRAINT [FK_es009000T0_es012000T0]
GO
/****** Object:  ForeignKey [FK_es096001T0_es007100T0]    Script Date: 06/27/2014 10:25:47 ******/
ALTER TABLE [dbo].[es096001T0]  WITH CHECK ADD  CONSTRAINT [FK_es096001T0_es007100T0] FOREIGN KEY([diag_detail_id])
REFERENCES [dbo].[es007100T0] ([diag_detail_id])
GO
ALTER TABLE [dbo].[es096001T0] CHECK CONSTRAINT [FK_es096001T0_es007100T0]
GO
/****** Object:  ForeignKey [FK_es096001T0_es009000T0]    Script Date: 06/27/2014 10:25:47 ******/
ALTER TABLE [dbo].[es096001T0]  WITH CHECK ADD  CONSTRAINT [FK_es096001T0_es009000T0] FOREIGN KEY([student_id])
REFERENCES [dbo].[es009000T0] ([student_id])
GO
ALTER TABLE [dbo].[es096001T0] CHECK CONSTRAINT [FK_es096001T0_es009000T0]
GO
/****** Object:  ForeignKey [FK_es100200T0_es100201T0]    Script Date: 06/27/2014 10:25:47 ******/
ALTER TABLE [dbo].[es100200T0]  WITH CHECK ADD  CONSTRAINT [FK_es100200T0_es100201T0] FOREIGN KEY([diag_case_id])
REFERENCES [dbo].[es100201T0] ([diag_case_id])
GO
ALTER TABLE [dbo].[es100200T0] CHECK CONSTRAINT [FK_es100200T0_es100201T0]
GO




--------------------query------------------------------------
SQL
drop table #test4
DECLARE @dd_dt_tm varchar(200)



SET @dd_dt_tm=(	SELECT	aa001300T0.timezone_name 
				FROM	aa001300T0
						INNER JOIN aa002200T0 ON aa002200T0.tm_zone_id=aa001300T0.timezone_id
				WHERE	aa002200T0.bl_id=1 )	



 select distinct 	
       cast(	CONVERT(int,ROUND(DATEDIFF(hour,es009000T0.stud_dob,dbo.gettingDatetime(@dd_dt_tm))/8766.0,0)) as varchar ) AS age, 
        aa004700T0.gender_name,
       es007100T0.diag_detail_desc,
       es096001T0.student_id as stud    INTO #test4
        from es007100T0
        inner join es096001T0 on es007100T0.update_id=es096001T0.diag_detail_id
        inner join es009000T0 on es009000T0.update_id=es096001T0.student_id and es009000T0.update_stat='A' and es009000T0.update_seq=1
        inner join aa004700T0 on aa004700T0.gender_id=es009000T0.gender_id
        inner join es100200T0 on es100200T0.update_id=es007100T0.diag_grp_id and es100200T0.update_stat='A' and es100200T0.update_seq=1
        inner join es100201T0 on es100201T0.diag_case_id=es100200T0.diag_case_id
        where es007100T0.update_stat='A' and es007100T0.update_seq=1 and es007100T0.rec_status='A' and
         es100201T0.diag_case_id=1 and es100200T0.rec_status='A' 

-----------getting column headers from diag_detail_desc row
DECLARE @columnHeaders NVARCHAR (MAX)
SELECT  @columnHeaders = COALESCE (@columnHeaders + ',[' + diag_detail_desc + ']', '[' + diag_detail_desc + ']')
FROM    #test4
--WHERE	Conditions
group BY diag_detail_desc

DECLARE @FinalQuery NVARCHAR(MAX)

/* Total COLUMN */
DECLARE @GrandTotalCol	NVARCHAR (MAX)
SELECT @GrandTotalCol = COALESCE (@GrandTotalCol + 'ISNULL ([' + 
CAST (diag_detail_desc AS VARCHAR) +'],0) + ', 'ISNULL([' + CAST(diag_detail_desc AS VARCHAR)+ '],0) + ')
FROM	#test4 
--ORDER BY diag_detail_desc
group BY diag_detail_desc
SET @GrandTotalCol = LEFT (@GrandTotalCol, LEN (@GrandTotalCol)-1)
--SELECT @GrandTotalCol

/* Total ROW */
DECLARE @GrandTotalRow	NVARCHAR(MAX)
SELECT @GrandTotalRow = COALESCE(@GrandTotalRow + ',ISNULL(SUM([' + 
CAST(diag_detail_desc AS VARCHAR)+']),0) ', 'ISNULL(SUM([' + CAST(diag_detail_desc AS VARCHAR)+']),0)')
FROM	#test4 
--ORDER BY  diag_detail_desc
group BY diag_detail_desc
--SELECT @GrandTotalRow


SET @FinalQuery = 	'SELECT *,('+ @GrandTotalCol + ')AS [Total] into #test5
			FROM
				(SELECT age,
					   gender_name,
					   diag_detail_desc,stud
				FROM #test4
				) A
			PIVOT
				(
				 COUNT(stud)
				 FOR diag_detail_desc
				 IN ('+@columnHeaders +')
				) B
ORDER BY age,gender_name
SELECT * FROM #test5
 UNION ALL 
SELECT ''Total'','''','+@GrandTotalRow +', 
ISNULL (SUM([Total]),0) FROM #test5
DROP TABLE #test5'

PRINT 'Pivot Queuery :'+ @FinalQuery
EXECUTE (@FinalQuery ) 

GeneralRe: nice work my +5v Pin
mannu baroli20-Jul-14 22:25
professionalmannu baroli20-Jul-14 22:25 
GeneralRe: nice work my +5v Pin
george49866-Aug-14 18:31
professionalgeorge49866-Aug-14 18:31 
QuestionCan i get sample code and table structure Pin
vishal_h26-Apr-14 5:14
vishal_h26-Apr-14 5:14 
QuestionPlease help me. Pin
testowy4325-Oct-12 7:23
testowy4325-Oct-12 7:23 
QuestionQuery Hang Pin
Member 943933218-Sep-12 6:11
Member 943933218-Sep-12 6:11 
Questionerror in sql server 2005 Pin
winchnet200516-Sep-12 23:59
winchnet200516-Sep-12 23:59 
QuestionCan some one Please help... What seems to be wrong with my cross tab query??? Pin
Jatelo_MVP25-Jun-12 21:56
Jatelo_MVP25-Jun-12 21:56 
GeneralMy vote of 5 Pin
Shahan Ayyub6-May-12 11:28
Shahan Ayyub6-May-12 11:28 
GeneralMy vote of 3 Pin
Chamila Nishantha2-May-12 21:30
Chamila Nishantha2-May-12 21:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.