dbTalk Databases Forums  

spliting up space delimited values in one column

microsoft.public.sqlserver.fulltext microsoft.public.sqlserver.fulltext


Discuss spliting up space delimited values in one column in the microsoft.public.sqlserver.fulltext forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Wendy Elizabeth
 
Posts: n/a

Default spliting up space delimited values in one column - 09-20-2005 , 07:11 PM






I am working with SQL Server 2000 table called dbo.proofofconcept".
I need to separate values that are all in one column that are space limited.
For example I have a column called tryit and the
value = '1234 456.75 01/01/2001 ABBR TRY (AT) GSU (DOT) ORG 75% $12.75 '.
I want to write a query so that the results can be split out to 7 output
columns. In other words, I would like the output to be:
Column 1 = 1234,
Column 2 = 456.75,
Column 3 = 01/01/2001,
Column 4 = ABBR,
Column 5 = TRY (AT) GSU (DOT) ORG,
Column 6 = 75%,
Column 7 = $12.75

The output would be separated into different columns for reporting purposes,
setup to create an output file, and possibly to be split into an XML file.
How would I go about writing a query like this? If this should be a stored
procedure, can you show me how I would write the stored procedure and how
would I execute the stored procedure?

Thanks!


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.