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.
Hi,I need select two stringsfor ex: transformer,torontoI need string 1.before ','2. after ','first string I got it:select SUBSTRING(Vendor_Address3,0,CHARINDEX(',',Vendor_Address3,0)),but second I dont knowp.s:in second sometimes have space before word,how I can do it?Thanks
James K
Master Smack Fu Yak Hacker
3873 Posts
Posted - 2013-11-04 : 16:30:54
Use LTRIM and/or RTRIM to remove leading and trailing spaces. Like shown below: