Update sStudent.tStudentImages SET OriginalStudentPhoto = StudentPhoto where StudentPhoto <> OriginalStudentPhoto

GO

UPDATE sStudent.tStudentImages
SET OriginalStudentPhoto = StudentPhoto
WHERE StudentPhoto IS NOT NULL
	AND OriginalStudentPhoto IS NULL
GO

UPDATE sStudent.tStudentImages
SET OriginalFatherPhoto = FatherPhoto
WHERE FatherPhoto IS NOT NULL
	AND OriginalFatherPhoto IS NULL
GO

UPDATE sStudent.tStudentImages
SET OriginalMotherPhoto = MotherPhoto
WHERE MotherPhoto IS NOT NULL
	AND OriginalMotherPhoto IS NULL
GO

UPDATE sStudent.tStudentImages
SET OriginalRelativePhoto = RelativePhoto
WHERE RelativePhoto IS NOT NULL
	AND OriginalRelativePhoto IS NULL
GO

UPDATE sStudent.tStudentImages  
SET StudentPhotoSize = DATALENGTH(OriginalStudentPhoto) / 1024.0  
WHERE OriginalStudentPhoto IS NOT NULL AND ISNULL(StudentPhotoSize,0) <= 0;  
GO