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 ««12

Generate HTML output for given SQL Query Expand / Collapse
Author
Message
Posted Tuesday, October 25, 2011 6:54 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, September 24, 2014 6:40 AM
Points: 5, Visits: 285
I would tend to agree with Mike Dougherty-384281. This approach seems like a bad idea for a number of reasons.

Why not use a "FOR XML" query and transform the XML on a web page?
Post #1196049
Posted Thursday, October 27, 2011 2:00 PM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Friday, September 26, 2014 12:25 PM
Points: 261, Visits: 913
dav0id (10/25/2011)
I would tend to agree with Mike Dougherty-384281. This approach seems like a bad idea for a number of reasons.

Why not use a "FOR XML" query and transform the XML on a web page?


I couldn't tell if your question is rhetorical, a suggestion, or an inquiry. :)

I would avoid using FOR XML on the general principle that it's still a large volume of string manipulation even if in the guise of a native feature. Mostly we're still using SQL Server 2000 instances and what I read of its newfangled XML capability made me think it should be avoided. Perhaps '2008 has evolved sufficiently that it's a viable solution.

If your proposed XML transform on the web page is using DOM methods on the XML document, the performance win you might be getting from requesting XML directly from the database (at the cost of exposing the server directly to clients?) you then pay in DOM method performance. A web service in front of the SQL Server minimizes server exposure, gives a web-side cache opportunity, and can probably respond to client-side/browser xmlhttp requests with JSON.

The author's original post is an example of a possible solution. As the opening move in the discussion that follows, I want to thank Raja Mohamed for taking the time to write it up. I felt it was a worthwhile contribution to this community to point out the potential scalability problem. Thanks dav0id for agreeing my concern is valid.

Post #1197196
Posted Tuesday, December 13, 2011 1:10 PM
Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: Friday, January 17, 2014 1:22 PM
Points: 727, Visits: 265
Raja,

Excellent job, thanks for sharing the code! Worked perfectly for me.

Regarding the last two persons to post comments - you make good points that there are better and more efficient ways, but you completely missed the spirit of the article. That is, there may be times when you don't have that perfect situation. For example, I needed a way to properly format my query for sending in the body of an email. This did the trick.

Paul


- Paul

http://paulpaivasql.blogspot.com/
Post #1221163
Posted Tuesday, July 16, 2013 7:58 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, September 25, 2014 5:22 AM
Points: 29, Visits: 127
So what is the final code for this tool. I would love to use this but I cannot see how. Where do you obtain the output after running this script via SSMS or do you obtain it from a job. Please help, I trying to get similar outputs for hard disk, logs, space reporting.

Thanks and regards,
Post #1474142
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse