IF NOT EXISTS (SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'TableName' AND COLUMN_NAME ='ColumnName')
BEGIN
ALTER TABLE TableName ADD ColumnName varchar(50) NULL
END
StatusDes
|
Scheduled
|
Registered
|
Scan Completed
|
Report Completed
|
In Progress
|
Report Despatched
|
DepartmentNames
|
Scheduled;Registered;Scan Completed;Report Completed;In Progress;Report Despatched;
|
EmpId
|
Yr
|
Sales
|
1
|
2005
|
12000
|
1
|
2006
|
18000
|
1
|
2007
|
25000
|
2
|
2005
|
15000
|
2
|
2006
|
6000
|
3
|
2006
|
20000
|
3
|
2007
|
24000
|
EmpId
|
2005
|
2006
|
2007
|
1
|
12000
|
18000
|
25000
|
2
|
15000
|
6000
|
NULL
|
3
|
NULL
|
20000
|
24000
|
class
|
rollno
|
section
|
marks
|
stuName
|
A
|
1
|
a
|
80
|
manoj
|
A
|
2
|
a
|
70
|
harish
|
A
|
3
|
a
|
80
|
kanchan
|
A
|
4
|
b
|
90
|
pooja
|
A
|
5
|
b
|
90
|
saurabh
|
A
|
6
|
b
|
50
|
anita
|
B
|
1
|
a
|
60
|
nitin
|
B
|
2
|
a
|
50
|
kamar
|
B
|
3
|
a
|
80
|
dinesh
|
B
|
4
|
b
|
90
|
paras
|
B
|
5
|
b
|
50
|
lalit
|
B
|
6
|
b
|
70
|
hema
|
class
|
section
|
sum
|
A
|
a
|
230
|
A
|
b
|
230
|
A
|
NULL
|
460
|
B
|
a
|
190
|
B
|
b
|
210
|
B
|
NULL
|
400
|
NULL
|
NULL
|
860
|