|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Splitting the string
Hi,
I have to split the string '$EmpId=1$;$EmpMgr=123$;$DeptNo=20$;' and get the EmpId,EmpMgr and DeptNo from that string for example i have to get 1,123 and 20. can anyone suggest me, how can we get the ids from the string . Regards, Ramnadh. |
|
#2
|
||||
|
||||
|
Is this a SQL question?
Using ASP or PHP et al, I'd perform a replace on the '$' (replace them with nothing - ""), then run the split() function over them, splitting at the ";". Then loop through the returned split array, splitting on the "=". |
|
#3
|
|||
|
|||
|
need it in T-sql
Thanx for your reply.
But i need it in T-sql. |
|
#4
|
||||
|
||||
|
Regardless, the same logic applies
http://www.sqlteam.com/item.asp?ItemID=2652 http://www.sqlteam.com/item.asp?ItemID=15044 |
![]() |
| Viewing: Dev Articles Community Forums > Databases > Microsoft SQL Server > Splitting the string |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|