NT User NorthWindob smith logged on to Parker, Kelly mailbox, and is not the primary Windows NT account on this mailbox. <br /><br />And from this you wanted to split this field up and get the following information from it:<br /><br />1. Northwindob smith<br />2. loggon on to Parker, Kelly mailbox<br />3. not the primary Windows NT<br /><br />How could I do it?<br /><br />[<img src='/community/emoticons/emotion-6.gif' alt='' />]
U can use the following query to acheive the output. declare @t1 varchar(2000) set @t1='NT User NorthWindob smith logged on to Parker, Kelly mailbox, and is not the primary Windows NT' select ltrim(rtrim(substring(@t1,1,charindex(' logged',@t1)))), ltrim(rtrim(substring(@t1,charindex(' logged',@t1),(charindex(', and',@t1)-charindex(' logged',@t1))))),ltrim(rtrim(substring(@t1,charindex('not',@t1),len(@t1)))) Rushendra