March 18, 2008 at 4:47 pm
Hi,
I need to convert a single column, result of a query yielding some rows with one column, into single row. I am using SQL 2000. Is it possible to do this with a Query? (Not by procedure)
March 18, 2008 at 5:10 pm
Since we're going short on details -
are we pivoting or aggregating?
Before and after sample of what you have and what you'd like would be nifty...Thanks!
----------------------------------------------------------------------------------
Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?
March 18, 2008 at 5:12 pm
G'day Mate,
I think I need to see an example to make this worth your while, but this type of work sounds like it would be covered by a cursor. Hit "Books online" and look for Cursor under "Transact SQL Reference".
It works by defining a variable data type, and using the process to "fetch" a record and when its done with that, it can "fetch" the next one.
Using a cursor in conjunction with "Cast" or "Convert" and some of the other text functions I'm guessing you'd be able to stitch something together.
I hope this might steer you in the right direction. This is where I would start! But for the life of me I can't think how you would be using data this way 🙂
- DamienB
March 18, 2008 at 5:31 pm
Please see the following article... explains how to do it and how NOT to do it...
http://www.sqlservercentral.com/articles/Test+Data/61572/
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply