RE: Sending query results to a text file

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Deepankar (anonymous_at_discussions.microsoft.com)
Date: 03/30/04


Date: Tue, 30 Mar 2004 14:16:06 -0800

You can do the following.
Fire the update statement in a stored procedure.
Use @@rowcount to get the no. of rows updated and return it as output parameter to the stored procedure.
Capture the above retuned value in a front end application like vb /asp and
use a mail app to send mail.
You can send mail using sql server too but I guess there are some issues with them.



Relevant Pages

  • Capture Result of Update?
    ... I have an Update statement in a stored procedure, and I want to capture ... the number of rows affected for returning to the caller. ...
    (microsoft.public.sqlserver.clients)
  • Re: How can a recordset returned by a sproc be updated?
    ... > While I run the test on my box I haven't seen update statement as OP said. ... >> SQL Server MVP ... >>> ADO. ... >>> internal text of the stored procedure? ...
    (microsoft.public.sqlserver.programming)
  • Re: Cannot update identity column PointOfSaleID.
    ... The sp_MSupd_PointOfSales stored procedure checks to see if the bit flag ... set and if so it executes an update statement which includes the identity ... for the identity column, it executes fine and chooses the else path. ...
    (microsoft.public.sqlserver.replication)
  • A few T-SQL questions...
    ... I have a few T-SQL questions that i'm hoping someone can answer for me. ... trips (i'm not using a stored procedure for this for several reasons). ... What's the best way to write an update statement so that only fields ... I have a table that has a trigger that does ...
    (microsoft.public.sqlserver)
  • Re: Updating data
    ... Did you look at the error message? ... I assume that you ran an UPDATE statement similar to the one Sue ... Since there is no stored procedure call in that statement, ... WHERE JOB_STATUS = 'For Sale/Lease' ...
    (microsoft.public.sqlserver.odbc)