Showing posts with label format. Show all posts
Showing posts with label format. Show all posts

Tuesday, March 27, 2012

Database Mirroring with Snapshots

This is a multi-part message in MIME format.
--=_NextPart_000_0012_01C8A463.A358EA10
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
When setting up database mirroring with snapshots, do you require a = completely separate physical server (the mirror server with the = snapshot) or can this server be another SQL instance on the same box?
Thank-you,
Rubens
--=_NextPart_000_0012_01C8A463.A358EA10
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&
When setting up database mirroring with = snapshots, do you require a completely separate physical server (the mirror server = with the snapshot) or can this server be another SQL instance on the same box?

Thank-you,
Rubens
--=_NextPart_000_0012_01C8A463.A358EA10--A database snapshot always reside in the same instance as the source database. If the snapshot is of
a mirrored database, then it need to be in the same instance as your mirrored database.
A mirror database is always in some *other* instance than the source database. The two instance
*can* be on the same machine, but that is only useful for demo-purposes (as it won't give your any
added fault tolerance).
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Rubens" <rubensrose@.hotmail.com> wrote in message news:%23KniQWIpIHA.3652@.TK2MSFTNGP03.phx.gbl...
When setting up database mirroring with snapshots, do you require a completely separate physical
server (the mirror server with the snapshot) or can this server be another SQL instance on the same
box?
Thank-you,
Rubens|||Okay makes sense, thank-you Tibor!
Rubens
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:eTiItfIpIHA.2208@.TK2MSFTNGP04.phx.gbl...
> A database snapshot always reside in the same instance as the source
> database. If the snapshot is of a mirrored database, then it need to be in
> the same instance as your mirrored database.
> A mirror database is always in some *other* instance than the source
> database. The two instance *can* be on the same machine, but that is only
> useful for demo-purposes (as it won't give your any added fault
> tolerance).
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "Rubens" <rubensrose@.hotmail.com> wrote in message
> news:%23KniQWIpIHA.3652@.TK2MSFTNGP03.phx.gbl...
> When setting up database mirroring with snapshots, do you require a
> completely separate physical server (the mirror server with the snapshot)
> or can this server be another SQL instance on the same box?
> Thank-you,
> Rubens
>

Saturday, February 25, 2012

Database Mail Operator Question

This is a multi-part message in MIME format.
--=_NextPart_000_002A_01C89897.E2CD2D00
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
I have two jobs configured to e-mail myself on completion, but I am not = currently receiving these notifications.
The SQL Agent is configured to use database mail, with a specific = private profile. Of note is that the button to "Test" the mail profile = is grayed out on the Alert System tab. When I execute sp_send_dbmail = using the e-mail address from the operator and use the profile name = defined in the SQL Agent properties, I receive an e-mail. However the = jobs themselves are not sending me any e-mail.
I've also confirmed the correct name of the profile in the = sysmail_profile table. The e-mail does not appear in sysmail_mailitems = and sysmail_send_retries is empty. So the job notification is not = getting queued.
Any ideas?
Thank-you,
Rubens
--=_NextPart_000_002A_01C89897.E2CD2D00
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&
I have two jobs configured to e-mail = myself on completion, but I am not currently receiving these notifications.

The SQL Agent is configured to use = database mail, with a specific private profile. Of note is that the button to = "Test" the mail profile is grayed out on the Alert System tab. When I execute = sp_send_dbmail using the e-mail address from the operator and use the = profile name defined in the SQL Agent properties, I receive an e-mail. = However the jobs themselves are not sending me any e-mail.

I've also confirmed the correct name of = the profile in the sysmail_profile table. The e-mail does not appear in sysmail_mailitems and sysmail_send_retries is empty. So the job notification is not getting queued.

Any ideas?

Thank-you,
Rubens
--=_NextPart_000_002A_01C89897.E2CD2D00--This is a multi-part message in MIME format.
--=_NextPart_000_0065_01C898E3.854A0D00
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi
What account is SQL Agent running under?
John
"Rubens" <rubensrose@.hotmail.com> wrote in message =news:%23Tec6mLmIHA.3780@.TK2MSFTNGP06.phx.gbl...
I have two jobs configured to e-mail myself on completion, but I am =not currently receiving these notifications.
The SQL Agent is configured to use database mail, with a specific =private profile. Of note is that the button to "Test" the mail profile =is grayed out on the Alert System tab. When I execute sp_send_dbmail =using the e-mail address from the operator and use the profile name =defined in the SQL Agent properties, I receive an e-mail. However the =jobs themselves are not sending me any e-mail.
I've also confirmed the correct name of the profile in the =sysmail_profile table. The e-mail does not appear in sysmail_mailitems =and sysmail_send_retries is empty. So the job notification is not =getting queued.
Any ideas?
Thank-you,
Rubens
--=_NextPart_000_0065_01C898E3.854A0D00
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&

Hi
What account is SQL Agent running under?
John
"Rubens" =wrote in message news:%23Tec6mLmIHA.=3780@.TK2MSFTNGP06.phx.gbl...
I have two jobs configured to e-mail =myself on completion, but I am not currently receiving these notifications.

The SQL Agent is configured to use =database mail, with a specific private profile. Of note is that the button to ="Test" the mail profile is grayed out on the Alert System tab. When I =execute sp_send_dbmail using the e-mail address from the operator and use the =profile name defined in the SQL Agent properties, I receive an e-mail. =However the jobs themselves are not sending me any e-mail.

I've also confirmed the correct name =of the profile in the sysmail_profile table. The e-mail does not appear =in sysmail_mailitems and sysmail_send_retries is empty. So the job notification is not getting queued.

Any ideas?

Thank-you,
Rubens

--=_NextPart_000_0065_01C898E3.854A0D00--|||This is a multi-part message in MIME format.
--=_NextPart_000_0067_01C898BF.22C59A10
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
It is running under a domain account that is an administrator on the =server, which is the same account the SQL Server service is running =under (I haven't split them up and restricted it as is recommended).
Thank-you,
Rubens
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message =news:O6%231lsNmIHA.1208@.TK2MSFTNGP05.phx.gbl...
Hi
What account is SQL Agent running under?
John
"Rubens" <rubensrose@.hotmail.com> wrote in message =news:%23Tec6mLmIHA.3780@.TK2MSFTNGP06.phx.gbl...
I have two jobs configured to e-mail myself on completion, but I am =not currently receiving these notifications.
The SQL Agent is configured to use database mail, with a specific =private profile. Of note is that the button to "Test" the mail profile =is grayed out on the Alert System tab. When I execute sp_send_dbmail =using the e-mail address from the operator and use the profile name =defined in the SQL Agent properties, I receive an e-mail. However the =jobs themselves are not sending me any e-mail.
I've also confirmed the correct name of the profile in the =sysmail_profile table. The e-mail does not appear in sysmail_mailitems =and sysmail_send_retries is empty. So the job notification is not =getting queued.
Any ideas?
Thank-you,
Rubens
--=_NextPart_000_0067_01C898BF.22C59A10
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&

It is running under a domain account =that is an administrator on the server, which is the same account the SQL Server =service is running under (I haven't split them up and restricted it as is recommended).
Thank-you,
Rubens
"John Bell" wrote in message news:O6%231lsNmIHA.=1208@.TK2MSFTNGP05.phx.gbl...
Hi

What account is SQL Agent running under?

John
"Rubens" =wrote in message news:%23Tec6mLmIHA.=3780@.TK2MSFTNGP06.phx.gbl...
I have two jobs configured to =e-mail myself on completion, but I am not currently receiving these notifications.

The SQL Agent is configured to use =database mail, with a specific private profile. Of note is that the =button to "Test" the mail profile is grayed out on the Alert System tab. =When I execute sp_send_dbmail using the e-mail address from the operator =and use the profile name defined in the SQL Agent properties, I receive an e-mail. However the jobs themselves are not sending me any e-mail.

I've also confirmed the correct =name of the profile in the sysmail_profile table. The e-mail does not =appear in sysmail_mailitems and sysmail_send_retries is empty. So the =job notification is not getting queued.

Any ideas?

Thank-you,
Rubens

--=_NextPart_000_0067_01C898BF.22C59A10--|||This is a multi-part message in MIME format.
--=_NextPart_000_0084_01C898EA.086587E0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi
And were you logged in as this account when you tested sp_send_dbmail?
John
"Rubens" <rubensrose@.hotmail.com> wrote in message =news:%23A5C6DOmIHA.5084@.TK2MSFTNGP04.phx.gbl...
It is running under a domain account that is an administrator on the =server, which is the same account the SQL Server service is running =under (I haven't split them up and restricted it as is recommended).
Thank-you,
Rubens
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message =news:O6%231lsNmIHA.1208@.TK2MSFTNGP05.phx.gbl...
Hi
What account is SQL Agent running under?
John
"Rubens" <rubensrose@.hotmail.com> wrote in message =news:%23Tec6mLmIHA.3780@.TK2MSFTNGP06.phx.gbl...
I have two jobs configured to e-mail myself on completion, but I =am not currently receiving these notifications.
The SQL Agent is configured to use database mail, with a specific =private profile. Of note is that the button to "Test" the mail profile =is grayed out on the Alert System tab. When I execute sp_send_dbmail =using the e-mail address from the operator and use the profile name =defined in the SQL Agent properties, I receive an e-mail. However the =jobs themselves are not sending me any e-mail.
I've also confirmed the correct name of the profile in the =sysmail_profile table. The e-mail does not appear in sysmail_mailitems =and sysmail_send_retries is empty. So the job notification is not =getting queued.
Any ideas?
Thank-you,
Rubens
--=_NextPart_000_0084_01C898EA.086587E0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&

Hi
And were you logged in as this account =when you tested sp_send_dbmail?
John
"Rubens" =wrote in message news:%23A5C6DOmIHA.=5084@.TK2MSFTNGP04.phx.gbl...
It is running under a domain account =that is an administrator on the server, which is the same account the SQL Server =service is running under (I haven't split them up and restricted it as is recommended).

Thank-you,
Rubens
"John Bell" wrote in message news:O6%231lsNmIHA.=1208@.TK2MSFTNGP05.phx.gbl...
Hi

What account is SQL Agent running under?

John
"Rubens" =wrote in message news:%23Tec6mLmIHA.=3780@.TK2MSFTNGP06.phx.gbl...
I have two jobs configured to =e-mail myself on completion, but I am not currently receiving these notifications.

The SQL Agent is configured to =use database mail, with a specific private profile. Of note is that the =button to "Test" the mail profile is grayed out on the Alert System =tab. When I execute sp_send_dbmail using the e-mail address from the =operator and use the profile name defined in the SQL Agent properties, I =receive an e-mail. However the jobs themselves are not sending me any e-mail.

I've also confirmed the correct =name of the profile in the sysmail_profile table. The e-mail does not =appear in sysmail_mailitems and sysmail_send_retries is empty. So the =job notification is not getting queued.

Any ideas?

Thank-you,
Rubens

--=_NextPart_000_0084_01C898EA.086587E0--|||This is a multi-part message in MIME format.
--=_NextPart_000_0012_01C898D9.9D37BCA0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hmmm, come to think of it, no I wasn't. I will have to test that when =back in the office tomorrow. I will let you know.
Thanks John.
Rubens
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message =news:erH9oGOmIHA.1184@.TK2MSFTNGP04.phx.gbl...
Hi
And were you logged in as this account when you tested sp_send_dbmail?
John
"Rubens" <rubensrose@.hotmail.com> wrote in message =news:%23A5C6DOmIHA.5084@.TK2MSFTNGP04.phx.gbl...
It is running under a domain account that is an administrator on the =server, which is the same account the SQL Server service is running =under (I haven't split them up and restricted it as is recommended).
Thank-you,
Rubens
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message =news:O6%231lsNmIHA.1208@.TK2MSFTNGP05.phx.gbl...
Hi
What account is SQL Agent running under?
John
"Rubens" <rubensrose@.hotmail.com> wrote in message =news:%23Tec6mLmIHA.3780@.TK2MSFTNGP06.phx.gbl...
I have two jobs configured to e-mail myself on completion, but I =am not currently receiving these notifications.
The SQL Agent is configured to use database mail, with a =specific private profile. Of note is that the button to "Test" the mail =profile is grayed out on the Alert System tab. When I execute =sp_send_dbmail using the e-mail address from the operator and use the =profile name defined in the SQL Agent properties, I receive an e-mail. =However the jobs themselves are not sending me any e-mail.
I've also confirmed the correct name of the profile in the =sysmail_profile table. The e-mail does not appear in sysmail_mailitems =and sysmail_send_retries is empty. So the job notification is not =getting queued.
Any ideas?
Thank-you,
Rubens
--=_NextPart_000_0012_01C898D9.9D37BCA0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&

Hmmm, come to think of it, no I =wasn't. I will have to test that when back in the office tomorrow. I will =let you know.
Thanks John.
Rubens
"John Bell" wrote in message news:erH9oGOmIHA.1184=@.TK2MSFTNGP04.phx.gbl...
Hi

And were you logged in as this =account when you tested sp_send_dbmail?

John
"Rubens" =wrote in message news:%23A5C6DOmIHA.=5084@.TK2MSFTNGP04.phx.gbl...
It is running under a domain =account that is an administrator on the server, which is the same account the SQL =Server service is running under (I haven't split them up and restricted it =as is recommended).

Thank-you,
Rubens
"John Bell" wrote in message news:O6%231lsNmIHA.=1208@.TK2MSFTNGP05.phx.gbl...
Hi

What account is SQL Agent running = under?

John
"Rubens" wrote in message news:%23Tec6mLmIHA.=3780@.TK2MSFTNGP06.phx.gbl...
I have two jobs configured to =e-mail myself on completion, but I am not currently receiving these notifications.

The SQL Agent is configured to =use database mail, with a specific private profile. Of note is that the =button to "Test" the mail profile is grayed out on the Alert System =tab. When I execute sp_send_dbmail using the e-mail address from the =operator and use the profile name defined in the SQL Agent properties, I =receive an e-mail. However the jobs themselves are not sending me =any e-mail.

I've also confirmed the correct =name of the profile in the sysmail_profile table. The e-mail does not =appear in sysmail_mailitems and sysmail_send_retries is empty. So =the job notification is not getting queued.

Any ideas?

Thank-you,
Rubens

--=_NextPart_000_0012_01C898D9.9D37BCA0--|||This is a multi-part message in MIME format.
--=_NextPart_000_000E_01C89951.401BBEE0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Yes, I was able to send an e-mail using T-SQL when logged in with the =account the SQL Server service / agent was using. I was able to fix the =problem, although I am not sure if it's a permanent solution.
The job operator e-mail address was a distribution list on Exchange. I =changed the e-mail address to include my own, ran the job, and one alert =came through fine. Then I sent it only to my account, again, worked =fine. I then retyped the operator e-mail address back in of the =distribution list and it succeeded. The one thing I am positive of is =that the e-mail address was correct right from the start because I use =the same e-mail address in the Pagers section. This was and is =identical to what was in the E-mail name of the operator.
Does this sound like a bug? I guess it's a little concerning =considering one of the benefits of database mail is it being SMTP based =and supposed to be a lot more reliable.
Thanks,
Rubens
"Rubens" <rubensrose@.hotmail.com> wrote in message =news:e1A60tPmIHA.2268@.TK2MSFTNGP02.phx.gbl...
Hmmm, come to think of it, no I wasn't. I will have to test that when =back in the office tomorrow. I will let you know.
Thanks John.
Rubens
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message =news:erH9oGOmIHA.1184@.TK2MSFTNGP04.phx.gbl...
Hi
And were you logged in as this account when you tested =sp_send_dbmail?
John
"Rubens" <rubensrose@.hotmail.com> wrote in message =news:%23A5C6DOmIHA.5084@.TK2MSFTNGP04.phx.gbl...
It is running under a domain account that is an administrator on =the server, which is the same account the SQL Server service is running =under (I haven't split them up and restricted it as is recommended).
Thank-you,
Rubens
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message =news:O6%231lsNmIHA.1208@.TK2MSFTNGP05.phx.gbl...
Hi
What account is SQL Agent running under?
John
"Rubens" <rubensrose@.hotmail.com> wrote in message =news:%23Tec6mLmIHA.3780@.TK2MSFTNGP06.phx.gbl...
I have two jobs configured to e-mail myself on completion, but =I am not currently receiving these notifications.
The SQL Agent is configured to use database mail, with a =specific private profile. Of note is that the button to "Test" the mail =profile is grayed out on the Alert System tab. When I execute =sp_send_dbmail using the e-mail address from the operator and use the =profile name defined in the SQL Agent properties, I receive an e-mail. =However the jobs themselves are not sending me any e-mail.
I've also confirmed the correct name of the profile in the =sysmail_profile table. The e-mail does not appear in sysmail_mailitems =and sysmail_send_retries is empty. So the job notification is not =getting queued.
Any ideas?
Thank-you,
Rubens
--=_NextPart_000_000E_01C89951.401BBEE0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&

Yes, I was able to send an e-mail using =T-SQL when logged in with the account the SQL Server service / agent was =using. I was able to fix the problem, although I am not sure if it=92s a permanent solution.
The job operator e-mail address was a =distribution list on Exchange. I changed the e-mail address to include my =own, ran the job, and one alert came through fine. Then I sent it only to =my account, again, worked fine. I then retyped the operator e-mail =address back in of the distribution list and it succeeded. The one thing I =am positive of is that the e-mail address was correct right from the start =because I use the same e-mail address in the Pagers section. This was and =is identical to what was in the E-mail name of the operator.
Does this sound like a bug? I =guess it=92s a little concerning considering one of the benefits of database mail is it =being SMTP based and supposed to be a lot more reliable.
Thanks,
Rubens
"Rubens" =wrote in message news:e1A60tPmIHA.2268=@.TK2MSFTNGP02.phx.gbl...
Hmmm, come to think of it, no I =wasn't. I will have to test that when back in the office tomorrow. I will =let you know.

Thanks John.

Rubens
"John Bell" wrote in message news:erH9oGOmIHA.1184=@.TK2MSFTNGP04.phx.gbl...
Hi

And were you logged in as this =account when you tested sp_send_dbmail?

John
"Rubens" =wrote in message news:%23A5C6DOmIHA.=5084@.TK2MSFTNGP04.phx.gbl...
It is running under a domain =account that is an administrator on the server, which is the same account the SQL =Server service is running under (I haven't split them up and restricted =it as is recommended).

Thank-you,
Rubens
"John Bell" wrote in message news:O6%231lsNmIHA.=1208@.TK2MSFTNGP05.phx.gbl...
Hi

What account is SQL Agent =running under?

John
"Rubens" wrote in message news:%23Tec6mLmIHA.=3780@.TK2MSFTNGP06.phx.gbl...
I have two jobs configured to =e-mail myself on completion, but I am not currently receiving =these notifications.

The SQL Agent is configured =to use database mail, with a specific private profile. Of note =is that the button to "Test" the mail profile is grayed out on the =Alert System tab. When I execute sp_send_dbmail using the =e-mail address from the operator and use the profile name defined in =the SQL Agent properties, I receive an e-mail. However the jobs themselves are not sending me any e-mail.

I've also confirmed the =correct name of the profile in the sysmail_profile table. The e-mail =does not appear in sysmail_mailitems and sysmail_send_retries is =empty. So the job notification is not getting queued.

Any ideas?

Thank-you,
Rubens

--=_NextPart_000_000E_01C89951.401BBEE0--|||This is a multi-part message in MIME format.
--=_NextPart_000_0019_01C89953.299E61C0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
I've just noticed another issue. I've created all my maintenance plans =using the wizard. When I go into the "Reporting and Logging" section =for the maintenance plan, I've selected the "Send report to an email =recipient" check box, the recipient being the same one that the job =alert sends to. However, I am not receiving the e-mail report. =Instead, I am only getting an e-mail from the job saying it has =completed. I don't get a report from the maintenance plan. I have also =confirmed that the logging file is created in a folder on the server.
Any idea why I am not getting this report in an e-mail?
Thank-you,
Rubens
"Rubens" <rubensrose@.hotmail.com> wrote in message =news:eC7QYMXmIHA.5684@.TK2MSFTNGP03.phx.gbl...
Yes, I was able to send an e-mail using T-SQL when logged in with the =account the SQL Server service / agent was using. I was able to fix the =problem, although I am not sure if it's a permanent solution.
The job operator e-mail address was a distribution list on Exchange. =I changed the e-mail address to include my own, ran the job, and one =alert came through fine. Then I sent it only to my account, again, =worked fine. I then retyped the operator e-mail address back in of the =distribution list and it succeeded. The one thing I am positive of is =that the e-mail address was correct right from the start because I use =the same e-mail address in the Pagers section. This was and is =identical to what was in the E-mail name of the operator.
Does this sound like a bug? I guess it's a little concerning =considering one of the benefits of database mail is it being SMTP based =and supposed to be a lot more reliable.
Thanks,
Rubens
"Rubens" <rubensrose@.hotmail.com> wrote in message =news:e1A60tPmIHA.2268@.TK2MSFTNGP02.phx.gbl...
Hmmm, come to think of it, no I wasn't. I will have to test that =when back in the office tomorrow. I will let you know.
Thanks John.
Rubens
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message =news:erH9oGOmIHA.1184@.TK2MSFTNGP04.phx.gbl...
Hi
And were you logged in as this account when you tested =sp_send_dbmail?
John
"Rubens" <rubensrose@.hotmail.com> wrote in message =news:%23A5C6DOmIHA.5084@.TK2MSFTNGP04.phx.gbl...
It is running under a domain account that is an administrator on =the server, which is the same account the SQL Server service is running =under (I haven't split them up and restricted it as is recommended).
Thank-you,
Rubens
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message =news:O6%231lsNmIHA.1208@.TK2MSFTNGP05.phx.gbl...
Hi
What account is SQL Agent running under?
John
"Rubens" <rubensrose@.hotmail.com> wrote in message =news:%23Tec6mLmIHA.3780@.TK2MSFTNGP06.phx.gbl...
I have two jobs configured to e-mail myself on completion, =but I am not currently receiving these notifications.
The SQL Agent is configured to use database mail, with a =specific private profile. Of note is that the button to "Test" the mail =profile is grayed out on the Alert System tab. When I execute =sp_send_dbmail using the e-mail address from the operator and use the =profile name defined in the SQL Agent properties, I receive an e-mail. =However the jobs themselves are not sending me any e-mail.
I've also confirmed the correct name of the profile in the =sysmail_profile table. The e-mail does not appear in sysmail_mailitems =and sysmail_send_retries is empty. So the job notification is not =getting queued.
Any ideas?
Thank-you,
Rubens
--=_NextPart_000_0019_01C89953.299E61C0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&

I've just noticed another issue. =I've created all my maintenance plans using the wizard. When I go into the ="Reporting and Logging" section for the maintenance plan, I've selected the "Send =report to an email recipient" check box, the recipient being the same one that the =job alert sends to. However, I am not receiving the e-mail =report. Instead, I am only getting an e-mail from the job saying it has =completed. I don't get a report from the maintenance plan. I have also =confirmed that the logging file is created in a folder on the server.
Any idea why I am not getting this =report in an e-mail?
Thank-you,
Rubens
"Rubens" =wrote in message news:eC7QYMXmIHA.5684=@.TK2MSFTNGP03.phx.gbl...
Yes, I was able to send an e-mail =using T-SQL when logged in with the account the SQL Server service / agent was using. I was able to fix the problem, although I am not sure if =it=92s a permanent solution.

The job operator e-mail address was a = distribution list on Exchange. I changed the e-mail address to include my own, ran the job, and one alert came through =fine. Then I sent it only to my account, again, worked fine. I then retyped =the operator e-mail address back in of the distribution list and it succeeded. The one thing I am positive of is that the e-mail =address was correct right from the start because I use the same e-mail address in =the Pagers section. This was and is identical to what was in the =E-mail name of the operator.

Does this sound like a bug? I =guess it=92s a little concerning considering one of the benefits of database mail is =it being SMTP based and supposed to be a lot more reliable.

Thanks,
Rubens
"Rubens" =wrote in message news:e1A60tPmIHA.2268=@.TK2MSFTNGP02.phx.gbl...
Hmmm, come to think of it, no I =wasn't. I will have to test that when back in the office tomorrow. I =will let you know.

Thanks John.

Rubens
"John Bell" wrote in message news:erH9oGOmIHA.1184=@.TK2MSFTNGP04.phx.gbl...
Hi

And were you logged in as this =account when you tested sp_send_dbmail?

John
"Rubens" wrote in message news:%23A5C6DOmIHA.=5084@.TK2MSFTNGP04.phx.gbl...
It is running under a domain =account that is an administrator on the server, which is the same account the =SQL Server service is running under (I haven't split them up and =restricted it as is recommended).

Thank-you,
Rubens
"John Bell" wrote in message news:O6%231lsNmIHA.=1208@.TK2MSFTNGP05.phx.gbl...
Hi

What account is SQL Agent =running under?

John
"Rubens" wrote in message news:%23Tec6mLmIHA.=3780@.TK2MSFTNGP06.phx.gbl...
I have two jobs configured =to e-mail myself on completion, but I am not currently receiving =these notifications.

The SQL Agent is configured =to use database mail, with a specific private profile. Of =note is that the button to "Test" the mail profile is grayed out on =the Alert System tab. When I execute sp_send_dbmail using =the e-mail address from the operator and use the profile name =defined in the SQL Agent properties, I receive an e-mail. However =the jobs themselves are not sending me any e-mail.

I've also confirmed the =correct name of the profile in the sysmail_profile table. The e-mail =does not appear in sysmail_mailitems and sysmail_send_retries is =empty. So the job notification is not getting queued.

Any ideas?

Thank-you,
Rubens

--=_NextPart_000_0019_01C89953.299E61C0--

Friday, February 24, 2012

Database mail in SQL Server 2005 - Email Query Results in Excel format?

Using database mail in SQL Server 2005, I can email the query results in form of a .txt attachment.

EXEC msdb.dbo.sp_send_dbmail
@.recipients=N'userName@.domain.com'
,@.body='Message Body'
,@.subject ='Message Subject'
,@.profile_name ='Mailer Profile'
,@.query ='SELECT * FROM SalesDb.dbo.SalesHistory'
,@.attach_query_result_as_file = 1
,@.query_attachment_filename ='Results.txt'

I want the query results in a CSV or preferably in Excel format. Can I achive that using database mail?

You have several options.

(a) You could use bcp to create the file, and the email the file as an attachment.

(b) You could revise the existing query to create csv formated data like this:

SELECT ''' + ',' + column1 + ',' + Col2 + ',' + {etc} + ''' FROM SalesDb.dbo.SalesHistory

(c) You could use xml to create a xml file that would be easily handled by Excel.

For the xml option, check in Books Online, Topics: OpenXML, FOR XML, Writing XML.