--获取在该字符串中某字符串的位置(返回数字)
select charindex('_','SD1092217A_0056')--返回11
--获取字符串的前3个字符
select left('SD1092217A_0056',11-1)--返回SD1092217A
select left('SD1092217A_0056',charindex('_','SD1092217A_0056') -1)--返回SD1092217A
select charindex('_','SD1092217A_0056')--返回11
--获取字符串的前3个字符
select left('SD1092217A_0056',11-1)--返回SD1092217A
select left('SD1092217A_0056',charindex('_','SD1092217A_0056') -1)--返回SD1092217A