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.
Author |
Topic |
R.Prabu
Starting Member
33 Posts |
Posted - 2008-06-04 : 09:52:40
|
I am having City, State i need to split these two string with comma separated and to search based on the city and state how to write the select queryany one know help meRegards,Prabu R |
|
Sep410
Posting Yak Master
117 Posts |
Posted - 2008-06-04 : 17:55:54
|
Declare @ST as varchar(20)Declare @City as varchar(20)Declare @State as varchar(20)Declare @i as intSet @ST='Saskatoon,SK'set @i =Patindex('%,%',@st)set @City=left(@ST,@i-1)set @State=Substring(@ST,@i+1,Len(@ST))Select @City,@StateDoes this help you? |
 |
|
|
|
|