Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
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-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Yesterday @ 8:47 PM
Points: 35,770, Visits: 32,436
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."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

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: Wednesday, July 16, 2014 1:06 PM
Points: 52, Visits: 315
Thanks for the code paul. It helped me a lot.
Post #1475795
Posted Saturday, July 20, 2013 10:00 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Yesterday @ 8:47 PM
Points: 35,770, Visits: 32,436
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."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

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