There is a column “AppendedData” in “Route” table . It stores data in this format
-------------
ID | AppendedData
1 | abc : xyz
2 | 123a : gvk
--------------
What I want is to write a search query over this “AppendedData” in where clause by spliting/substring it in two parts . The part before “:” is to be used in matching the values.
The current application that i am working is an old one so I can’t go for writing an stored procedure . So what I am left is writing query in c# and executing it and returning a datable. So how can I do this in c#??
I was trying this in sql server till now it is returning the second part ie, after “:”.
my query:
select SUBSTRING(AppendedData,CHARINDEX(':',AppendedData)+1, 100) from route
Try this,
In
SQLIn
C#