Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Hello therei am trying to work out how i can select left of a character.egemailaddress@hotmail.com;emailaddress2@hotmail.comi want to select the address to the left of ';'
stepson
Aged Yak Warrior
545 Posts
Posted - 2012-11-22 : 07:03:22
declare @str as varchar(500)set @str ='emailaddress@hotmail.com;emailaddress2@hotmail.com'select charindex(';',@str,1), substring(@str, 1,charindex(';',@str,1)-1), left(@str,charindex(';',@str,1)-1)Ce-am pe mine am si-n dulap, cand ma-mbrac zici ca ma mutsabinWeb
masterdineen
Aged Yak Warrior
550 Posts
Posted - 2012-11-22 : 09:35:14
silly question, but what about everything to the right of ';'