Net Send From SQL 2005 Server

  • I have create a ASP page where you select the date and time and some customer info LogID and phone and the IP address of the person that entered the data.

    Now this info is entered into the Database.

    The date and time will be in the future.

    I want to use the Stored procdure master.dbo.xp_cmdshell to use NET Send to send a message to the IP address of the computer that entered the information 20 minutes before the time entered into the database and again at 5 minutes.

    I think what I have to do in the database server is create a trigger. Or maybe a stored Procedure. I just dont know where to start.

    Is there anyone out there that can help me with this?

    I am realy desprate to get this running for my Boss , or something even better for that matter.
  • Best thing is store the data that needs to be Net Sent in a table somewhere. You can make a copy or even just add a field in your table to track that the info is sent. Then set up a stored proc to read the table, get data that isn't sent and run xp_cmdshell to sent it. That's a manual thing.

    Now schedule that stored proc in a job to run every minute or so . Then if there's stuff to send, it will get sent.

  • Be careful trying to rely on NET send as this function is turned off on a lot of client systems by default.  I believe it was with XP Service Pack 2 that this changed. 

    A more reliable option would be to send email through SMTP to the requested user.  You could use either SQL 2005 Database Mail or one of the many SP's out there that work on any SQL version.  You can search this site for sp_SQLSMTPMail which is one of them listed.

    Good Luck!

    Chad

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

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