Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 New help fast - Changing the resultset

Author  Topic 

kleinmi
Starting Member

9 Posts

Posted - 2002-07-31 : 13:00:52
Hello,

I have a huge sql query that returns the following output

DATE SEVERITY BACKLOG
date1 1 33
date1 2 44
date1 3 55
date1 4 66

I want to change the output to look like this

Date Severity_1 Severity_2 Severity_3 Severity_4
date1 33 44 55 66

The SQL statment is large and complex, so I was wondering if there is a way I could do a SELECT statement on top of that query to change the look of the output

Thanks!
michael


nr
SQLTeam MVY

12543 Posts

Posted - 2002-07-31 : 14:05:59
There is an article on the site about cross tab queries (think it's one of Robs).
You can put the result of the Sp into a temp table and use that.

If you want something generic I answered a question somewhere about putting the results of an sp into a temp table without knowing what the format was using openquery. (I wouldn't advise it though).


==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -