GPSPOW
asked on
Output Stored Procedure data to Text File
Here is the end of the Stored Procedure I have. It has gone through many steps to create temporary values in the "Final Calculation". After the "Final Calculation" is done, the results are outputted to the screen.
I want to send these values to a text or csv file.
Here is the code:
/* FINAL CALCULATION */
SET @Denominator = (SELECT COUNT(VisitID) FROM #StrokePopulation)
SET @Numerator = (SELECT COUNT(VisitID) FROM #Numerator)
SET @Exclusions = (SELECT COUNT(VisitID) FROM #Exclusions)
/* Output for Attestation */
SELECT
@MeasureNumberIdentifier AS 'Measure'
,@ReportName AS 'Report Name'
,@Denominator AS 'Denominator'
,@Numerator AS 'Numerator'
,@Exclusions AS 'Exclusions'
/* Output Detail for patients meeting Performance Numerator */
IF @Detail = 'Y'
SELECT 'Yes' AS [Meets Measure],*
FROM #Numerator
Is "BCP" an option?
thanks
Glen
I want to send these values to a text or csv file.
Here is the code:
/* FINAL CALCULATION */
SET @Denominator = (SELECT COUNT(VisitID) FROM #StrokePopulation)
SET @Numerator = (SELECT COUNT(VisitID) FROM #Numerator)
SET @Exclusions = (SELECT COUNT(VisitID) FROM #Exclusions)
/* Output for Attestation */
SELECT
@MeasureNumberIdentifier AS 'Measure'
,@ReportName AS 'Report Name'
,@Denominator AS 'Denominator'
,@Numerator AS 'Numerator'
,@Exclusions AS 'Exclusions'
/* Output Detail for patients meeting Performance Numerator */
IF @Detail = 'Y'
SELECT 'Yes' AS [Meets Measure],*
FROM #Numerator
Is "BCP" an option?
thanks
Glen
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Do I need to qualify the "@" variables ( @MeasureNumberIdentifier, @Numerator, etc) to send to the text file?
or
Do I need to store the output variables into a table and then use BCP to export the table to the text file?
Glen
or
Do I need to store the output variables into a table and then use BCP to export the table to the text file?
Glen
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Our server is down now.
As soon as the administrator reboots it, I will try out your suggestion.
Thanks
Glen
As soon as the administrator reboots it, I will try out your suggestion.
Thanks
Glen
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I like all the solutions.
Mark's was exactly what I was looking for.
Thanks
glen
Mark's was exactly what I was looking for.
Thanks
glen
Hth - Mike