how to put the result of a query in the subject line of the email using sp_send_dbmail in SQL 2005?
something like
you have "465" rows in this table
something like
you have "465" rows in this table
TheMadProfessor
If you are merely plugging in the result of a count query, this would be relatively simple - just define a string variable and make its value the result of stringing the returned count with whatever constant text you want:
someString = "You have " + sqlResult + " rows in this table."
where sqlResult is the defined variable for capturing the result from your query. Then just use someString as one of the parms in sp_send_dbmail as usual.