Home > Archive > MS SQL Server MSEQ > September 2005 > space delimited values in one column









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author space delimited values in one column
Wendy Elizabeth

2005-09-20, 8:24 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@GSU.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@GSU.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!

Steve Kass

2005-09-21, 3:24 am

Answered in your other thread, " comma delimited"

SK

Wendy Elizabeth wrote:

>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@GSU.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@GSU.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!
>
>
>

Wendy Elizabeth

2005-09-21, 11:24 am

STEVE:

I WILL ONLY ANSWER QUESTIONS IN ONE THREAD.

"Steve Kass" wrote:

> Answered in your other thread, " comma delimited"
>
> SK
>
> Wendy Elizabeth wrote:
>
>

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com