Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12

Need Split delimiter string into columns Solution Expand / Collapse
Author
Message
Posted Friday, April 26, 2013 9:24 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Yesterday @ 9:45 PM
Points: 40,992, Visits: 38,289
gauravupadhyay2009 (4/26/2013)
Thanks a lot for writing this wonderful SQL Code. it gave me relax that i could not get 2 days.
i used this code in BULK Insert from .txt file data.with delim (|) .
thanks again

Gaurav Upadhyay
India


Why would you need to use any of the code on this thread if you used BULK INSERT? And if the code is the WHILE loop code, you may have built in a bit of a performance problem into your code.


--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

Helpful Links:
How to post code problems
How to post performance problems
Post #1447062
Posted Saturday, July 20, 2013 9:19 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Thursday, September 24, 2015 12:10 PM
Points: 52, Visits: 317
Thanks for the code paul. It helped me a lot.
Post #1475795
Posted Saturday, July 20, 2013 10:00 PM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Yesterday @ 9:45 PM
Points: 40,992, Visits: 38,289
syamkakarla (7/20/2013)
Thanks for the code paul. It helped me a lot.


Take a look at the Green and Blue lines in the following chart and compare them to the skinny black line. The Green and Blue lines are two different methods using WHILE loops. Don't use WHILE loops to do splits. Please see the following article for a much better method of splitting VARCHAR(8000) or less.
http://www.sqlservercentral.com/articles/Tally+Table/72993/



--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

Helpful Links:
How to post code problems
How to post performance problems
Post #1475799
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse