Monday, March 12, 2012
How to configure Email notification?
I am not sure if I am posting my question at the right place. Anyway, I hope
someone can help me out.
I have a scheduled job in SQL server agent and I would like to configure the
email notification if the job fails. When I tried to create a new email
operator name, I clicked on the small button [...] besides the "Email Name"
textbox, an error message "Unable to logon to the mail system. You should
start a mail client (Microsoft Outlook or Microsoft Exchange Client) to use
this feature." appeared. Can any teach me how to do the configuration?
Thanks a lot!
Ivanhttp://support.microsoft.com/default.aspx?scid=kb;en-us;263556&sd=tech
HTH, Jens Suessmeyer.|||I don't like the fact a mapi client has to be loaded on the box for SQL Mail,
doesn't seem best practice... ...I prefer to use a script.
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "Test Message"
objMessage.From = "SQLServer"
objMessage.To = "" 'Insert email address here.
objMessage.TextBody = "Notification message (" & FormatDateTime(Date,1) & ",
" & FormatDateTime(Time,4) & ")"
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "exchange" 'Insert your exchange server name here
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objMessage.Configuration.Fields.Update
objMessage.Send
Set objMessage = Nothing
"Ivan" wrote:
> Dear all,
> I am not sure if I am posting my question at the right place. Anyway, I hope
> someone can help me out.
> I have a scheduled job in SQL server agent and I would like to configure the
> email notification if the job fails. When I tried to create a new email
> operator name, I clicked on the small button [...] besides the "Email Name"
> textbox, an error message "Unable to logon to the mail system. You should
> start a mail client (Microsoft Outlook or Microsoft Exchange Client) to use
> this feature." appeared. Can any teach me how to do the configuration?
> Thanks a lot!
> Ivan
>|||And for me I dont like using the old fashioned Scripting approach, did
you suggest using the xp_smtp_sendmail procedure. It uses a non-mapi
interface (SMTP) to send out mails, it has some restrictions, but and
the other hand some great features, like sending out HTML mails (I know
thats the hell for some of you guys :-) ), giving friendly names, etc.
You can download that on:
http://www.sqldev.net/xp/xpsmtp.htm
HTH, Jens Suessmeyer.|||I'm not sure if you will be upgrading to SQL 2005 anytime soon, but
mail is much improved in 2005. There is no need for email clients to
be installed and you don't have to write your own object and you don't
need any 3rd party xp.
Jens wrote:
> And for me I dont like using the old fashioned Scripting approach, did
> you suggest using the xp_smtp_sendmail procedure. It uses a non-mapi
> interface (SMTP) to send out mails, it has some restrictions, but and
> the other hand some great features, like sending out HTML mails (I know
> thats the hell for some of you guys :-) ), giving friendly names, etc.
> You can download that on:
> http://www.sqldev.net/xp/xpsmtp.htm
> HTH, Jens Suessmeyer.
How to configure Email notification?
I am not sure if I am posting my question at the right place. Anyway, I hope
someone can help me out.
I have a scheduled job in SQL server agent and I would like to configure the
email notification if the job fails. When I tried to create a new email
operator name, I clicked on the small button [...] besides the "Email Name"
textbox, an error message "Unable to logon to the mail system. You should
start a mail client (Microsoft Outlook or Microsoft Exchange Client) to use
this feature." appeared. Can any teach me how to do the configuration?
Thanks a lot!
Ivan
http://support.microsoft.com/default...263556&sd=tech
HTH, Jens Suessmeyer.
|||I don't like the fact a mapi client has to be loaded on the box for SQL Mail,
doesn't seem best practice... ...I prefer to use a script.
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "Test Message"
objMessage.From = "SQLServer"
objMessage.To = "" 'Insert email address here.
objMessage.TextBody = "Notification message (" & FormatDateTime(Date,1) & ",
" & FormatDateTime(Time,4) & ")"
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "exchange" 'Insert your exchange server name here.
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objMessage.Configuration.Fields.Update
objMessage.Send
Set objMessage = Nothing
"Ivan" wrote:
> Dear all,
> I am not sure if I am posting my question at the right place. Anyway, I hope
> someone can help me out.
> I have a scheduled job in SQL server agent and I would like to configure the
> email notification if the job fails. When I tried to create a new email
> operator name, I clicked on the small button [...] besides the "Email Name"
> textbox, an error message "Unable to logon to the mail system. You should
> start a mail client (Microsoft Outlook or Microsoft Exchange Client) to use
> this feature." appeared. Can any teach me how to do the configuration?
> Thanks a lot!
> Ivan
>
|||And for me I dont like using the old fashioned Scripting approach, did
you suggest using the xp_smtp_sendmail procedure. It uses a non-mapi
interface (SMTP) to send out mails, it has some restrictions, but and
the other hand some great features, like sending out HTML mails (I know
thats the hell for some of you guys :-) ), giving friendly names, etc.
You can download that on:
http://www.sqldev.net/xp/xpsmtp.htm
HTH, Jens Suessmeyer.
|||I'm not sure if you will be upgrading to SQL 2005 anytime soon, but
mail is much improved in 2005. There is no need for email clients to
be installed and you don't have to write your own object and you don't
need any 3rd party xp.
Jens wrote:
> And for me I dont like using the old fashioned Scripting approach, did
> you suggest using the xp_smtp_sendmail procedure. It uses a non-mapi
> interface (SMTP) to send out mails, it has some restrictions, but and
> the other hand some great features, like sending out HTML mails (I know
> thats the hell for some of you guys :-) ), giving friendly names, etc.
> You can download that on:
> http://www.sqldev.net/xp/xpsmtp.htm
> HTH, Jens Suessmeyer.
How to configure Email notification?
I am not sure if I am posting my question at the right place. Anyway, I hope
someone can help me out.
I have a scheduled job in SQL server agent and I would like to configure the
email notification if the job fails. When I tried to create a new email
operator name, I clicked on the small button [...] besides the "Email Na
me"
textbox, an error message "Unable to logon to the mail system. You should
start a mail client (Microsoft Outlook or Microsoft Exchange Client) to use
this feature." appeared. Can any teach me how to do the configuration?
Thanks a lot!
Ivanhttp://support.microsoft.com/defaul...;263556&sd=tech
HTH, Jens Suessmeyer.|||I don't like the fact a mapi client has to be loaded on the box for SQL Mail
,
doesn't seem best practice... ...I prefer to use a script.
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "Test Message"
objMessage.From = "SQLServer"
objMessage.To = "" 'Insert email address here.
objMessage.TextBody = "Notification message (" & FormatDateTime(Date,1) & ",
" & FormatDateTime(Time,4) & ")"
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/confi
guration/sendusing") = 2
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/confi
guration/smtpserver") = "exchange" 'Insert your exchange server name here.
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/confi
guration/smtpserverport") = 25
objMessage.Configuration.Fields.Update
objMessage.Send
Set objMessage = Nothing
"Ivan" wrote:
> Dear all,
> I am not sure if I am posting my question at the right place. Anyway, I ho
pe
> someone can help me out.
> I have a scheduled job in SQL server agent and I would like to configure t
he
> email notification if the job fails. When I tried to create a new email
> operator name, I clicked on the small button [...] besides the "Email
Name"
> textbox, an error message "Unable to logon to the mail system. You should
> start a mail client (Microsoft Outlook or Microsoft Exchange Client) to us
e
> this feature." appeared. Can any teach me how to do the configuration?
> Thanks a lot!
> Ivan
>|||And for me I dont like using the old fashioned Scripting approach, did
you suggest using the xp_smtp_sendmail procedure. It uses a non-mapi
interface (SMTP) to send out mails, it has some restrictions, but and
the other hand some great features, like sending out HTML mails (I know
thats the hell for some of you guys :-) ), giving friendly names, etc.
You can download that on:
http://www.sqldev.net/xp/xpsmtp.htm
HTH, Jens Suessmeyer.|||I'm not sure if you will be upgrading to SQL 2005 anytime soon, but
mail is much improved in 2005. There is no need for email clients to
be installed and you don't have to write your own object and you don't
need any 3rd party xp.
Jens wrote:
> And for me I dont like using the old fashioned Scripting approach, did
> you suggest using the xp_smtp_sendmail procedure. It uses a non-mapi
> interface (SMTP) to send out mails, it has some restrictions, but and
> the other hand some great features, like sending out HTML mails (I know
> thats the hell for some of you guys :-) ), giving friendly names, etc.
> You can download that on:
> http://www.sqldev.net/xp/xpsmtp.htm
> HTH, Jens Suessmeyer.
How to configure distributor thread for being up while replicated database is down
I often deal with a problem when replicated database is down due to electric outage or any other scheduled type of downtime. Primary database is up but distribution agent is going down 'after 10 attempts to connect to replicated database'. That's the problem I think because not only distribution agent goes in undetermined state and I have to restart sqlagent service, but I need to go through whole process of snapshot and applaying it to replicated db. I would like it to accumulate transactions in distribution database and once replicated db is up - distribute them.
I wonder if anybody can tell me how to configure distribution thread so it does not go down after 10 unsuccessfull attempts but stays for day or two.
Thank you, Gene.
Gene, why do you need to re-apply the snapshot, is your retention period very small? By default it's 72 hours, so if distribution agent can get back up within that time period, it should just pick up where it left off.
Unfortunately if your distribution agent is running in Continuous mode (which you mention since it goes down after 10 unsuccessful attempts), the workaround would be change it so that the agent runs on a scheduled interval, like every minute. This way in the case the machine gets knocked off the network, the agent will always run every N minutes, pass or fail. As soon as the machine gets back on the network, it should pick up where it left off, provide the oldest txn that hasn't been replicated is within the retention period.
|||The other possible solution is to increate the number of retry attempts for your distribution agent job, when you view job steps of an agent job, there is an advanced tab, on that screen, you can specify a big value for "Retry Attempts" and how often you want the retry to happen "Retry Interval (minutes)". For example, if you want the retry lasts for 2 days, you could put 2880 for Retry Attempts and 1 for Retry Interval.
Hope that helps,
Zhiqiang Feng
This posting is provided "AS IS" with no warranties, and confers no rights.
|||I don't think this exists for SQL 2000, but if it does, then this is also a good solution.Sunday, February 19, 2012
How to check whether an SSIS package is executing
I have scheduled an SQL Job to run every 15 mins. This runs an SSIS package. But sometimes my package might execute for more than 15 mins. In this case, a second instance of the package would start. I don't want this to happen. So is there any way I can check whether the package is already running before I continue the execution of the same. Right now I am using a mutex to handle this problem. Are there any problems using the mutex and is there a better way to handle this?
Thanks in advance.
Sumesh
have you tried using the sql server profiler?|||Actually the entire process is an automated process. I want my SSIS or the SQL job to check whether an instance it has initiated earlier is not running when the next instance has to be started.|||Interesting problem. There is no way that I know of to check whether a package is already executing or not. A good way of getting around this is to disable the Agent job at the start of the package and then re-enable it again at the end. I would probably do this even if I *could* check if a package was running or not.
-Jamie
|||Thank you Jamie! But if I disable the job and then re-enable it after the execution of my package, won't the agent wait for another 15 mins before it starts the next execution of the package?|||i recently heard in an msdn webcast that package execution can be monitored in the sql server management studio object explorer, but i haven't tried this.|||
Hi Sumesh,
I think you could use a scripting task and SMO to extract the current run status of the job:
http://msdn2.microsoft.com/en-us/library/microsoft.sqlserver.management.smo.agent.job.currentrunstatus.aspx
cheers,
Markus