在数据库中根据身份证号算出生日期
update Staff_information set
csny =
case when LEN(sfzh)=18 then (substring(sfzh,7,4) +'-'+ substring(sfzh,11,2)+'-'+ substring(sfzh,13,2))
when LEN(sfzh)=15 then ('19' + substring(sfzh,7,2) +'-'+ substring(sfzh,9,2)+'-'+ substring(sfzh,11,2))
else null
end
from Staff_information