日期:2014-05-17 浏览次数:20792 次
declare @details nvarchar(50)
set @details='10.2.0.1 DEV_10 zhang_san'
select left(@details,charindex(' ',@details)-1) as ip,
substring(@details,charindex(' ',@details)+1,charindex(' ',substring(@details,charindex(' ',@details)+1,len(@details)))-1) as department,
right(@details,charindex(' ',REVERSE(@details))-1) as user