Showing posts with label e-mail. Show all posts
Showing posts with label e-mail. Show all posts

Monday, March 19, 2012

AUtomatic mail alert

HI,

I have to send an automatic e-mail based on database table .Could any body help me

how to write stored procedure and where to execute it.How to send an automatic e-mail through sql server?

Thanks in advance.

Regards,

Raja.

Hi Raja,

To send an email in a stored procedure in SQL Server, you can call xp_sendmail directly.

http://msdn2.microsoft.com/en-us/library/ms189505(SQL.90).aspx

Before this, you have to configure an extended MAPI mail profile. Here is a link for how to do it.

http://msdn2.microsoft.com/en-us/library/ms175189(SQL.90).aspx

However, you can also read data from the database table and do this in your .net application, using the System.Net.Mail.MailMessage class.

http://msdn2.microsoft.com/en-us/library/system.net.mail.mailmessage.aspx

HTH. If this does not answer your question, please feel free to mark the post as Not Answered and reply. Thank you!

Friday, February 24, 2012

autogrow speed

Hi,
SQL 2000
We set up all of our databases to autogrow 10%.
Given a 4G database, how fast would 10% autogrowth be?
How can I get notified via e-mail whenever autogrowth occurs?
Would autogrowth be logged in the SQL 2000 server log?
I'd appreciate if anybody can shed some light or point me to the right
direction to figure out myself.
Thanks,
Bing> Given a 4G database, how fast would 10% autogrowth be?
Create a database with a tiny log file and a 400MB size datafile and you will see how your
disksubsystem will perform. Autogrow performs the same way as the initial creation. On my machine
(desktop, 7200 RPM IDE) it took 8 seconds.
> How can I get notified via e-mail whenever autogrowth occurs?
Not easily. You can catch it through a Profiler trace. In order for you to get notified of it, you
would have to use the Profiler GUI and log to a table, on which you have a trigger defined.
> Would autogrowth be logged in the SQL 2000 server log?
No.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"bing" <bing@.discussions.microsoft.com> wrote in message
news:715AA77D-9849-48AC-8CCA-7E862590769B@.microsoft.com...
> Hi,
> SQL 2000
> We set up all of our databases to autogrow 10%.
> Given a 4G database, how fast would 10% autogrowth be?
> How can I get notified via e-mail whenever autogrowth occurs?
> Would autogrowth be logged in the SQL 2000 server log?
> I'd appreciate if anybody can shed some light or point me to the right
> direction to figure out myself.
> Thanks,
> Bing|||"bing" <bing@.discussions.microsoft.com> wrote in message
news:715AA77D-9849-48AC-8CCA-7E862590769B@.microsoft.com...
> Hi,
> SQL 2000
> We set up all of our databases to autogrow 10%.
> Given a 4G database, how fast would 10% autogrowth be?
> How can I get notified via e-mail whenever autogrowth occurs?
> Would autogrowth be logged in the SQL 2000 server log?
>
As Tibor says test it.
However, I would NOT use 10% autogrowth.
If you have a 4GB DB, the first time it tries to autogrow, it'll reserve
400MB of disk space.
Next time, 440 MB.
After that 484 MB.
And so on.
So each time it takes longer and longer.
> I'd appreciate if anybody can shed some light or point me to the right
> direction to figure out myself.
> Thanks,
> Bing
Greg Moore
SQL Server DBA Consulting Remote and Onsite available!
Email: sql (at) greenms.com http://www.greenms.com/sqlserver.html|||Thanks for the response. That makes sense. Sounds like using percentage is
not good if autogrowth is performed frequently.
"Greg D. Moore (Strider)" wrote:
>
> "bing" <bing@.discussions.microsoft.com> wrote in message
> news:715AA77D-9849-48AC-8CCA-7E862590769B@.microsoft.com...
> > Hi,
> >
> > SQL 2000
> >
> > We set up all of our databases to autogrow 10%.
> >
> > Given a 4G database, how fast would 10% autogrowth be?
> > How can I get notified via e-mail whenever autogrowth occurs?
> > Would autogrowth be logged in the SQL 2000 server log?
> >
> As Tibor says test it.
> However, I would NOT use 10% autogrowth.
> If you have a 4GB DB, the first time it tries to autogrow, it'll reserve
> 400MB of disk space.
> Next time, 440 MB.
> After that 484 MB.
> And so on.
> So each time it takes longer and longer.
>
> > I'd appreciate if anybody can shed some light or point me to the right
> > direction to figure out myself.
> >
> > Thanks,
> >
> > Bing
>
> --
> Greg Moore
> SQL Server DBA Consulting Remote and Onsite available!
> Email: sql (at) greenms.com http://www.greenms.com/sqlserver.html
>
>|||"bing" <bing@.discussions.microsoft.com> wrote in message
news:B410EBB9-84DA-4557-B978-046FF0099275@.microsoft.com...
> Thanks for the response. That makes sense. Sounds like using percentage
> is
> not good if autogrowth is performed frequently.
>
Actually if you're performing autogrowth with any frequency you probably
have a problem.
You should try to manually manage space and grow it as necessary (if at all)
at slow times.
> "Greg D. Moore (Strider)" wrote:
>>
Greg Moore
SQL Server DBA Consulting Remote and Onsite available!
Email: sql (at) greenms.com http://www.greenms.com/sqlserver.html

autogrow speed

Hi,
SQL 2000
We set up all of our databases to autogrow 10%.
Given a 4G database, how fast would 10% autogrowth be?
How can I get notified via e-mail whenever autogrowth occurs?
Would autogrowth be logged in the SQL 2000 server log?
I'd appreciate if anybody can shed some light or point me to the right
direction to figure out myself.
Thanks,
Bing
> Given a 4G database, how fast would 10% autogrowth be?
Create a database with a tiny log file and a 400MB size datafile and you will see how your
disksubsystem will perform. Autogrow performs the same way as the initial creation. On my machine
(desktop, 7200 RPM IDE) it took 8 seconds.

> How can I get notified via e-mail whenever autogrowth occurs?
Not easily. You can catch it through a Profiler trace. In order for you to get notified of it, you
would have to use the Profiler GUI and log to a table, on which you have a trigger defined.

> Would autogrowth be logged in the SQL 2000 server log?
No.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"bing" <bing@.discussions.microsoft.com> wrote in message
news:715AA77D-9849-48AC-8CCA-7E862590769B@.microsoft.com...
> Hi,
> SQL 2000
> We set up all of our databases to autogrow 10%.
> Given a 4G database, how fast would 10% autogrowth be?
> How can I get notified via e-mail whenever autogrowth occurs?
> Would autogrowth be logged in the SQL 2000 server log?
> I'd appreciate if anybody can shed some light or point me to the right
> direction to figure out myself.
> Thanks,
> Bing
|||"bing" <bing@.discussions.microsoft.com> wrote in message
news:715AA77D-9849-48AC-8CCA-7E862590769B@.microsoft.com...
> Hi,
> SQL 2000
> We set up all of our databases to autogrow 10%.
> Given a 4G database, how fast would 10% autogrowth be?
> How can I get notified via e-mail whenever autogrowth occurs?
> Would autogrowth be logged in the SQL 2000 server log?
>
As Tibor says test it.
However, I would NOT use 10% autogrowth.
If you have a 4GB DB, the first time it tries to autogrow, it'll reserve
400MB of disk space.
Next time, 440 MB.
After that 484 MB.
And so on.
So each time it takes longer and longer.

> I'd appreciate if anybody can shed some light or point me to the right
> direction to figure out myself.
> Thanks,
> Bing
Greg Moore
SQL Server DBA Consulting Remote and Onsite available!
Email: sql (at) greenms.com http://www.greenms.com/sqlserver.html
|||Thanks for the response. That makes sense. Sounds like using percentage is
not good if autogrowth is performed frequently.
"Greg D. Moore (Strider)" wrote:

>
> "bing" <bing@.discussions.microsoft.com> wrote in message
> news:715AA77D-9849-48AC-8CCA-7E862590769B@.microsoft.com...
> As Tibor says test it.
> However, I would NOT use 10% autogrowth.
> If you have a 4GB DB, the first time it tries to autogrow, it'll reserve
> 400MB of disk space.
> Next time, 440 MB.
> After that 484 MB.
> And so on.
> So each time it takes longer and longer.
>
>
> --
> Greg Moore
> SQL Server DBA Consulting Remote and Onsite available!
> Email: sql (at) greenms.com http://www.greenms.com/sqlserver.html
>
>
|||"bing" <bing@.discussions.microsoft.com> wrote in message
news:B410EBB9-84DA-4557-B978-046FF0099275@.microsoft.com...
> Thanks for the response. That makes sense. Sounds like using percentage
> is
> not good if autogrowth is performed frequently.
>
Actually if you're performing autogrowth with any frequency you probably
have a problem.
You should try to manually manage space and grow it as necessary (if at all)
at slow times.
[vbcol=seagreen]
> "Greg D. Moore (Strider)" wrote:
Greg Moore
SQL Server DBA Consulting Remote and Onsite available!
Email: sql (at) greenms.com http://www.greenms.com/sqlserver.html

autogrow speed

Hi,
SQL 2000
We set up all of our databases to autogrow 10%.
Given a 4G database, how fast would 10% autogrowth be?
How can I get notified via e-mail whenever autogrowth occurs?
Would autogrowth be logged in the SQL 2000 server log?
I'd appreciate if anybody can shed some light or point me to the right
direction to figure out myself.
Thanks,
Bing> Given a 4G database, how fast would 10% autogrowth be?
Create a database with a tiny log file and a 400MB size datafile and you wil
l see how your
disksubsystem will perform. Autogrow performs the same way as the initial cr
eation. On my machine
(desktop, 7200 RPM IDE) it took 8 seconds.

> How can I get notified via e-mail whenever autogrowth occurs?
Not easily. You can catch it through a Profiler trace. In order for you to g
et notified of it, you
would have to use the Profiler GUI and log to a table, on which you have a t
rigger defined.

> Would autogrowth be logged in the SQL 2000 server log?
No.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"bing" <bing@.discussions.microsoft.com> wrote in message
news:715AA77D-9849-48AC-8CCA-7E862590769B@.microsoft.com...
> Hi,
> SQL 2000
> We set up all of our databases to autogrow 10%.
> Given a 4G database, how fast would 10% autogrowth be?
> How can I get notified via e-mail whenever autogrowth occurs?
> Would autogrowth be logged in the SQL 2000 server log?
> I'd appreciate if anybody can shed some light or point me to the right
> direction to figure out myself.
> Thanks,
> Bing|||"bing" <bing@.discussions.microsoft.com> wrote in message
news:715AA77D-9849-48AC-8CCA-7E862590769B@.microsoft.com...
> Hi,
> SQL 2000
> We set up all of our databases to autogrow 10%.
> Given a 4G database, how fast would 10% autogrowth be?
> How can I get notified via e-mail whenever autogrowth occurs?
> Would autogrowth be logged in the SQL 2000 server log?
>
As Tibor says test it.
However, I would NOT use 10% autogrowth.
If you have a 4GB DB, the first time it tries to autogrow, it'll reserve
400MB of disk space.
Next time, 440 MB.
After that 484 MB.
And so on.
So each time it takes longer and longer.

> I'd appreciate if anybody can shed some light or point me to the right
> direction to figure out myself.
> Thanks,
> Bing
Greg Moore
SQL Server DBA Consulting Remote and Onsite available!
Email: sql (at) greenms.com http://www.greenms.com/sqlserver.html|||Thanks for the response. That makes sense. Sounds like using percentage i
s
not good if autogrowth is performed frequently.
"Greg D. Moore (Strider)" wrote:

>
> "bing" <bing@.discussions.microsoft.com> wrote in message
> news:715AA77D-9849-48AC-8CCA-7E862590769B@.microsoft.com...
> As Tibor says test it.
> However, I would NOT use 10% autogrowth.
> If you have a 4GB DB, the first time it tries to autogrow, it'll reserve
> 400MB of disk space.
> Next time, 440 MB.
> After that 484 MB.
> And so on.
> So each time it takes longer and longer.
>
>
> --
> Greg Moore
> SQL Server DBA Consulting Remote and Onsite available!
> Email: sql (at) greenms.com [url]http://www.greenms.com/sqlserver.html[/ur
l]
>
>|||"bing" <bing@.discussions.microsoft.com> wrote in message
news:B410EBB9-84DA-4557-B978-046FF0099275@.microsoft.com...
> Thanks for the response. That makes sense. Sounds like using percentage
> is
> not good if autogrowth is performed frequently.
>
Actually if you're performing autogrowth with any frequency you probably
have a problem.
You should try to manually manage space and grow it as necessary (if at all)
at slow times.
[vbcol=seagreen]
> "Greg D. Moore (Strider)" wrote:
>
Greg Moore
SQL Server DBA Consulting Remote and Onsite available!
Email: sql (at) greenms.com http://www.greenms.com/sqlserver.html