Wrox Home  
Search P2P Archive for: Go

  Return to Index  

sql_language thread: Split String


Message #1 by "Raju S.Pusapati" <rajupusapati@y...> on Tue, 25 Jun 2002 20:01:17
CHARINDEX(expression1, expression2 [, start_location])

... is equvilent to InStr() check BOL for details...

SUBSTRING(expression, start, length)

... is like Mid().

HTH
Greg

-----Original Message-----
From:	Raju S.Pusapati [SMTP:rajupusapati@y...]
Sent:	Tuesday, June 25, 2002 3:01 PM
To:	sql language
Subject:	[sql_language] Split String

Hi,
I am working on a table containing name column with both lastname and 
firstname in the same column separated with spaces.I need to split the 
name into firstname, middlename and/or lastname.I tried using instr 
fucntion from VB but it is not supported with SQL Server database.Please 
let me know which function I have to use in T-SQL to split the strings 
using space as delimiter.Any sample code will be highly appreciated.
Thanks.


  Return to Index