p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   SQL Language (http://p2p.wrox.com/forumdisplay.php?f=100)
-   -   Sql query output to XML or HTML file (http://p2p.wrox.com/showthread.php?t=58709)

miamikk June 4th, 2007 06:48 PM

Sql query output to XML or HTML file
 
I am a newbie to SQL and I would like to know how can I save the SQL SP query output to an XML or directly to an HTML file ? I need to know how it can be done programatically as I need to generate about 5K-8K reports changing 3 input variables in the SP.

The Stored Procedure and output can be viewed in the image below
http://www.fiu.edu/~atmakurk/kk/results.jpg

The input variables that change are @District, @Month and @RepType.

I would appreciate if anyone can guide me or provide me with link to an article or example on how its done.

Thanks
KK


happygv June 5th, 2007 01:44 AM

KK,

Which version of SQL server are you using?

If it is Sql server 2000...
For XML output, you need to consider using
Code:

FOR XML AUTO
at the end of SELECT statement.

For HTML output, you may consider using sp_makewebtask and sp_runwebtask


_________________________
- Vijay G
Strive for Perfection

miamikk June 5th, 2007 07:25 AM

I am using SQL server 2005.


miamikk June 5th, 2007 04:14 PM

FOR XML AUTO generates an xml file but do you know or direct me to syntax on how to save the file to a folder ?


Quote:

quote:Originally posted by happygv
 KK,

Which version of SQL server are you using?

If it is Sql server 2000...
For XML output, you need to consider using
Code:

FOR XML AUTO
at the end of SELECT statement.

For HTML output, you may consider using sp_makewebtask and sp_runwebtask


_________________________
- Vijay G
Strive for Perfection

happygv June 6th, 2007 03:58 AM

You may use BCP utility for storing that into a file under a folder.

_________________________
- Vijay G
Strive for Perfection


All times are GMT -4. The time now is 11:19 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.