dynamically formatting result set text?

  • Is it possible to dynamically format the text (font color, specifically) of a result set based on certain conditions?

    I'm running a script several times a day that gives status updates on my system and I wanted to see if I could format that result text to be red if there is some specified criteria is met.

    Thanks in advance

  • No you cannot dynamically format result set text in Query Analyzer or any other direct SQL tool that I am aware of. If this is that important to you and you are using SQL 2000 I would use Reporting Services and run the scripts there as the report data source(s) and then use Reporting Service to format the results.

    If you don't have 2000 then you would need to write some kind of UI that runs the scripts and does the formatting. Or I think you could use a Job that mails you the results in HTML format and you could embed HTML tags in your results.

    Basically SQL is a data language and does not do formatting, that's what GUI's are for.

    Jack Corbett
    Consultant - Straight Path Solutions
    Check out these links on how to get faster and more accurate answers:
    Forum Etiquette: How to post data/code on a forum to get the best help
    Need an Answer? Actually, No ... You Need a Question

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply