I have one SELECT
statement which returns me for example 10 rows. Out of these 10 rows, I want to mark 5 rows in red color. Is this possible with SQL 开发者_JAVA百科Server 2008?
No. It is not possible directly.
But you could copy the results into Excel and colour there.
SQL Server has no real concept of output in this sense beyond a collection of results sets and the text log. Any display concerns (such as colouring cells, setting column widths, pagination) are the responsibility of your client application.
You could potentially make your SQL Server code return embedded metadata to inform the client of how to display sections (which isn't something where there's a standard interface I know of, you'd just be defining your own metadata and writing a client to read it), but I suspect that's beyond the scope of where you're heading here.
精彩评论