Click here to Skip to main content
15,610,088 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I split the column name: Data into 200 static column .and its working .Now I have one challenge that i want parse that particular values into respective column number
For example :
data	data1	data2	data3
1___39300346.1638873276,75___not logged-in	1___39300346.1638873276	75___not logged-in	

i want parse
75___not logged-in
the values into column number 75 i.e columnname:data75

parse thes value into column number i.e coulmnname:data1

could you please help on that ?

What I have tried:

tried to apply string function/tvf/char index
Updated 17-Jan-22 22:08pm

1 solution

The best advice I can give you is simple: don't.

SQL string handling is at worst primitive, and at best poor because it's a data storage and retrieval language, not a data processing language. It's excellent at storing and retrieving data based on the relationships between data items and the filters / criteria you provide to reduce or aggregate the data - but it's it not designed for data processing.

That's what presentation languages are there for: getting input, manipulating it into a "sensible form" and passing it to the DB ready for storage - and that's why presentation languages have better string manipulation functions, regular expression support, data checking and conversion functions and SQL doesn't.

Do all that in your presentation language, and it will produce better code, that is much easier to maintain and understand. It's possible in SQL, but when a mod comes along in two months time because of a condition you didn't think of it's going to be an impenetrable mess of SQL code to try and change to accommodate it!
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900