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

stacked columns in a report table? Expand / Collapse
Author
Message
Posted Friday, June 7, 2013 3:49 PM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Yesterday @ 9:12 PM
Points: 1,349, Visits: 2,874
Is there a way to "stack" columns in a table on a report?

My example would be getting some info out of [msdb].[dbo].[sysjobhistory]. I'd like to see the name of the job (and _id), the step_id, step_name, run_date, run_time and run_duration on one "row", with the message on the next (see attached).

I can't create different datasets as there would be multiple rows per job_id and I'd like them to "meld".

select
j.name
,j.job_id
,jh.step_id
,jh.step_name
,jh.run_date
,jh.run_time
,jh.run_duration
,jh.message
from
sysjobs j inner join sysjobhistory jh on j.job_id = jh.job_id
where
jh.job_id = '<some job id>'



----------------------------------------------------------------------------
Sacramento SQL Server users group - http://sac.sqlpass.org
Follow me on Twitter - @SQLDCH
----------------------------------------------------------------------------

Yeah, well...The Dude abides.


  Post Attachments 
Untitled.png (6 views, 6.61 KB)
Post #1461243
Posted Tuesday, June 11, 2013 2:37 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Friday, June 6, 2014 7:41 AM
Points: 41, Visits: 165
Hi

Maybe you can create 2 new detail lines
Then join the text box on the first detail line to put the static text "Message"
and then do the same with the second detail line and put the field Message on it

Post #1462376
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse