Showing posts with label sqlmail. Show all posts
Showing posts with label sqlmail. Show all posts

Monday, March 26, 2012

Emailing a table

All that Iâ'm trying to do is nightly email a table. Whatâ's the easiest way to do this? It seems that SQLMail would be an overkill but I donâ't know
Thanks for your help
ToIf you could use SMTP, get hold of xp_smtp_sendmail from http://SQLDev.net.
This is an extended stored procedure for sending emails from SQL Server.
You just need a way of creating a text file with the table data. You could
use either BCP or DTS for this. Once the file is created, email it using
xp_smtp_sendmail.
--
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
Is .NET important for a database professional?
http://vyaskn.tripod.com/poll.htm
"TomZ" <anonymous@.discussions.microsoft.com> wrote in message
news:47E94190-0DD5-470B-BA20-422F2D1C3D98@.microsoft.com...
All that I'm trying to do is nightly email a table. What's the easiest way
to do this? It seems that SQLMail would be an overkill but I don't know?
Thanks for your help!
Tom|||Thanks! I can get as far as getting the file creating using a job under SQL Server Agent that runs a query to return the table and create a txt file, so the last step will be to get it emailed with sendmail.
Thanks again
To
-- Narayana Vyas Kondreddi wrote: --
If you could use SMTP, get hold of xp_smtp_sendmail from http://SQLDev.net
This is an extended stored procedure for sending emails from SQL Server
You just need a way of creating a text file with the table data. You coul
use either BCP or DTS for this. Once the file is created, email it usin
xp_smtp_sendmail
-
HTH
Vyas, MVP (SQL Server
http://vyaskn.tripod.com
Is .NET important for a database professional
http://vyaskn.tripod.com/poll.ht
"TomZ" <anonymous@.discussions.microsoft.com> wrote in messag
news:47E94190-0DD5-470B-BA20-422F2D1C3D98@.microsoft.com..
All that I'm trying to do is nightly email a table. What's the easiest wa
to do this? It seems that SQLMail would be an overkill but I don't know
Thanks for your help
To

Emailing a table

All that I’m trying to do is nightly email a table. What’s the easiest
way to do this? It seems that SQLMail would be an overkill but I don’t kn
ow?
Thanks for your help!
TomIf you could use SMTP, get hold of xp_smtp_sendmail from http://SQLDev.net.
This is an extended stored procedure for sending emails from SQL Server.
You just need a way of creating a text file with the table data. You could
use either BCP or DTS for this. Once the file is created, email it using
xp_smtp_sendmail.
--
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
Is .NET important for a database professional?
http://vyaskn.tripod.com/poll.htm
"TomZ" <anonymous@.discussions.microsoft.com> wrote in message
news:47E94190-0DD5-470B-BA20-422F2D1C3D98@.microsoft.com...
All that I'm trying to do is nightly email a table. What's the easiest way
to do this? It seems that SQLMail would be an overkill but I don't know?
Thanks for your help!
Tom|||Thanks! I can get as far as getting the file creating using a job under SQL
Server Agent that runs a query to return the table and create a txt file, s
o the last step will be to get it emailed with sendmail.
Thanks again!
Tom
-- Narayana Vyas Kondreddi wrote: --
If you could use SMTP, get hold of xp_smtp_sendmail from http://SQLDev.net.
This is an extended stored procedure for sending emails from SQL Server.
You just need a way of creating a text file with the table data. You could
use either BCP or DTS for this. Once the file is created, email it using
xp_smtp_sendmail.
--
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
Is .NET important for a database professional?
http://vyaskn.tripod.com/poll.htm
"TomZ" <anonymous@.discussions.microsoft.com> wrote in message
news:47E94190-0DD5-470B-BA20-422F2D1C3D98@.microsoft.com...
All that I'm trying to do is nightly email a table. What's the easiest way
to do this? It seems that SQLMail would be an overkill but I don't know?
Thanks for your help!
Tom

Thursday, March 22, 2012

email trigger

I'd like to setup a trigger to send an email, but can't use SQLMail because
I don't control the password to the account that is running the MSSQLSERVER
service. Is there any other way to have SQL send an email when an insert is
made to a particular table? Plus IT doesn't like the idea of Outlook
installed on a production server.You could use xp_smtp_mail. It requires that the ability to access a smtp
mail server. Quite 'safe' for a production server -unlike MAPI.
Mail -Sending
SQL 2000 - http://www.sqldev.net/xp/xpsmtp.htm
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
"Colin" <legendsfan@.spamhotmail.com> wrote in message
news:%23IQu$hjxGHA.3892@.TK2MSFTNGP03.phx.gbl...
> I'd like to setup a trigger to send an email, but can't use SQLMail
> because I don't control the password to the account that is running the
> MSSQLSERVER service. Is there any other way to have SQL send an email
> when an insert is made to a particular table? Plus IT doesn't like the
> idea of Outlook installed on a production server.
>|||Hi Colin
It is not really advisable to send emails from triggers as you will
potentially be increasing the transaction time significantly and therefore
increasing contention (blocking/deadlocking etc..). An alternative would be
to populate another table and then periodically have a process that emails
the information and clears the table down.
John
"Colin" wrote:
> I'd like to setup a trigger to send an email, but can't use SQLMail because
> I don't control the password to the account that is running the MSSQLSERVER
> service. Is there any other way to have SQL send an email when an insert is
> made to a particular table? Plus IT doesn't like the idea of Outlook
> installed on a production server.
>
>

email trigger

I'd like to setup a trigger to send an email, but can't use SQLMail because
I don't control the password to the account that is running the MSSQLSERVER
service. Is there any other way to have SQL send an email when an insert is
made to a particular table? Plus IT doesn't like the idea of Outlook
installed on a production server.You could use xp_smtp_mail. It requires that the ability to access a smtp
mail server. Quite 'safe' for a production server -unlike MAPI.
Mail -Sending
SQL 2000 - http://www.sqldev.net/xp/xpsmtp.htm
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
"Colin" <legendsfan@.spamhotmail.com> wrote in message
news:%23IQu$hjxGHA.3892@.TK2MSFTNGP03.phx.gbl...
> I'd like to setup a trigger to send an email, but can't use SQLMail
> because I don't control the password to the account that is running the
> MSSQLSERVER service. Is there any other way to have SQL send an email
> when an insert is made to a particular table? Plus IT doesn't like the
> idea of Outlook installed on a production server.
>|||Hi Colin
It is not really advisable to send emails from triggers as you will
potentially be increasing the transaction time significantly and therefore
increasing contention (blocking/deadlocking etc..). An alternative would be
to populate another table and then periodically have a process that emails
the information and clears the table down.
John
"Colin" wrote:

> I'd like to setup a trigger to send an email, but can't use SQLMail becaus
e
> I don't control the password to the account that is running the MSSQLSERVE
R
> service. Is there any other way to have SQL send an email when an insert
is
> made to a particular table? Plus IT doesn't like the idea of Outlook
> installed on a production server.
>
>

Wednesday, March 21, 2012

Email replication Notifications/alerts with xp_smtp_sendmail?

Hello,
I installed the xpsmtp80.dll for sql server 2000 so that I can send emails
from sql server without using sqlmail. xpsmtp80.dll uses the
xp_smtp_sendmail extended stored procedure. This works find from query
analyzer and from stored procedures called from dts jobs... But how to
implement/use xp_smtp_sendmail with replication notifications/alerts?
I looked at the properties of the distribution agent and in the
notifications tab there is an option to email the operator when the job
fails. But this uses sqlmail, which I want to circumvent because I don't
want to use outlook on the server machine. How can I invoke an sp like this
one when a replication job fails?
CREATE PROCEDURE stp_testEmailproc
AS
declare @.rc int, @.s varchar(100)
SET @.s = 'Job failed on ' + cast(getdate() AS varchar(30))
exec @.rc = master.dbo.xp_smtp_sendmail
@.FROM = 'joe@.joe123.net',
@.FROM_NAME = 'joe',
@.TO = 'joe@.joe123.net',
@.priority = 'HIGH',
@.subject = 'Replication Failure Alert',
@.message = @.s,
@.type = 'text/plain',
@.server = 'mail.joe123.net'
select RC = @.rc
GO
Thanks,
Rich
Hi Rich,
I work with a lot of replication databases. One of the concerns we have
is to instantly notify us when a replication fails as we use huge DBs
to replicate over the general Internet and we cannot afford to do a
resynch as it will take days(even weeks).
So what we have done is develop a SQL Job that only sends out an email
taking an optional parameter.
On the Replication alerts, I have configured all the alerts to call
this job. This helps us inform there is an issue but we still have to
log in to see what failed. Also you can modify the distribution SQL
Jobs to call this job if the step fails.. That way you can use the
optional parameter to pass the step detail name to pin point which
agent failed... Hope this helps..
Rich wrote:
> Hello,
> I installed the xpsmtp80.dll for sql server 2000 so that I can send emails
> from sql server without using sqlmail. xpsmtp80.dll uses the
> xp_smtp_sendmail extended stored procedure. This works find from query
> analyzer and from stored procedures called from dts jobs... But how to
> implement/use xp_smtp_sendmail with replication notifications/alerts?
> I looked at the properties of the distribution agent and in the
> notifications tab there is an option to email the operator when the job
> fails. But this uses sqlmail, which I want to circumvent because I don't
> want to use outlook on the server machine. How can I invoke an sp like this
> one when a replication job fails?
> CREATE PROCEDURE stp_testEmailproc
> AS
> declare @.rc int, @.s varchar(100)
> SET @.s = 'Job failed on ' + cast(getdate() AS varchar(30))
> exec @.rc = master.dbo.xp_smtp_sendmail
> @.FROM = 'joe@.joe123.net',
> @.FROM_NAME = 'joe',
> @.TO = 'joe@.joe123.net',
> @.priority = 'HIGH',
> @.subject = 'Replication Failure Alert',
> @.message = @.s,
> @.type = 'text/plain',
> @.server = 'mail.joe123.net'
> select RC = @.rc
> GO
> Thanks,
> Rich
|||Well, at least there is a way to do this. Right now I just need a way to get
notified by email when replication fails. How do you configure Replication
alerts to call a job?
"Query Builder" wrote:

> Hi Rich,
> I work with a lot of replication databases. One of the concerns we have
> is to instantly notify us when a replication fails as we use huge DBs
> to replicate over the general Internet and we cannot afford to do a
> resynch as it will take days(even weeks).
> So what we have done is develop a SQL Job that only sends out an email
> taking an optional parameter.
> On the Replication alerts, I have configured all the alerts to call
> this job. This helps us inform there is an issue but we still have to
> log in to see what failed. Also you can modify the distribution SQL
> Jobs to call this job if the step fails.. That way you can use the
> optional parameter to pass the step detail name to pin point which
> agent failed... Hope this helps..
>
>
> Rich wrote:
>
|||Rich,
have a look at the "Replication: agent failure" alert. On the response tab
there is an "Execute job" checkbox...
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com .