views:

44

answers:

2

Possible Duplicate:
SQL CASE statement

Hi Frdz, i have created a stored proc and i put three queries in stored proc with inputvariable @EtlLoadId = 0 and i get three different windows for each query under result tab. is there any chance i can get results from the stored proc (results of three queries) as only one window and results one below another under result tab ?

IF (SELECT EtlLoadId 
 FROM  ssislogs.audit.processcontrol 
 WHERE SubjectArea = 'UaqaFacetsImp') > 0
SELECT pc.SrcFileName + ' - '+  CONVERT(VARCHAR(10), pc.[RecordCount] ) AS FacetsImpCount
 FROM  ssislogs.audit.processcontrol pc left outer join
 Uaqa.LettersAndCardsExports lc
on pc.etlloadid = lc.etlloadid
  WHERE pc.subjectarea = 'UaqaFacetsImp'
ELSE
SELECT 'No input file' AS FacetsImpCount

SELECT pc.subjectarea AS FacetsRjctFile
FROM  ssislogs.audit.processcontrol pc left outer join
Uaqa.LettersAndCardsExports lc
on pc.etlloadid = lc.etlloadid
  WHERE pc.subjectarea = 'UaqaFacetsRjct'

SELECT pc.subjectarea AS FacetsPvsFile
FROM  ssislogs.audit.processcontrol pc left outer join
Uaqa.LettersAndCardsExports lc
on pc.etlloadid = lc.etlloadid
  WHERE pc.subjectarea = 'UaqaFacetsPvs'

Thanks

A: 

Set your query results window to view as text and all three will be together.

Bob Palmer
+1  A: 

Assuming SQL Server based on some clues, use text mode, not grid mode in SSMS

Before executing:

  • Control+T = text mode
  • Control+G = grid mode

It makes no different to the actual execution: 3 result sets returned.

gbn