Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 sql job

Author  Topic 

akas
Starting Member

42 Posts

Posted - 2008-04-23 : 13:55:24
Can anyone tell me about the sql job run?

well, i have to run one sql job and it says mail queued. but it not delievered till yet..i check in sql agent database mail profile is enabled..

so what's the reason? can anyone help me?

thanks,
Akash.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-04-23 : 13:56:43
Check your email server.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-04-23 : 13:57:15
Check whether you get mail or not by testing DBmail? How did you set up?
Go to Top of Page

akas
Starting Member

42 Posts

Posted - 2008-04-23 : 14:06:39
thanks for ur reply,


well, sodeep i checked thru
EXEC msdb.dbo.sp_send_dbmail
@profile_name = 'PR',
@recipients = 'akas@email.com',
@body = 'The procedure finished successfully.',
@subject = ' Testmail-Automated Success Message'

but it says mail queued..but i haven't delievered yet..
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-04-23 : 14:09:33
So do you get mail while testing from DBMail directly? Not as a job
Go to Top of Page

akas
Starting Member

42 Posts

Posted - 2008-04-23 : 14:23:37
no not from any side...from dbmail - it says MAIL QUEUED.
and in job run - job failed.

thanks,
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-04-23 : 14:27:03
Actually you have restart SQL agent to take effect. Make sure no jobs are running at the time you are doing it.

Looks like you haven't setup profile right. Tell us step-by-step how you setup Database mail?
Go to Top of Page

akas
Starting Member

42 Posts

Posted - 2008-04-23 : 14:59:28
i follow the steps from BOL of database mail.
i also restart and tried but it says that - mail queued.

means my email has already sent but i didn't get it. may be server problem? or what?
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-04-23 : 15:05:04
Are you using outlook express?
Go to SQL agent properties- enable your profile
Go to SQL Surface area config.-enable Database mail.

What exactly are you trying to mail? Is there any query ? Post it .
Go to Top of Page

akas
Starting Member

42 Posts

Posted - 2008-04-23 : 15:26:14
quote:
Originally posted by sodeep

Are you using outlook express? - yes
Go to SQL agent properties- enable your profile enabled alreadyGo to SQL Surface area config.-enable Database mail. enabled already
What exactly are you trying to mail? Is there any query ? Post it .



i have to execute simple update statement :

update salestab
set transsales = (select replace(transales, substring(transales,1,len(transales)-4),'transsales outdated')

where (transdate < dateAdd(m, -3, convert(datetime, convert(varchar(10), getdate(), 112), 112)))


Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-04-23 : 15:26:58
What does an update statement have to do with Database Mail?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

akas
Starting Member

42 Posts

Posted - 2008-04-23 : 15:35:19
i have update statement in the sproc.
and i ahve to run job weekly every sunday 5pm - to check before 3months older all salestransaction..i ahve to update then as outdated.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-04-23 : 15:41:01
But you aren't running the update statement when you are sending the email. I'm sure you are running the query before the email.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/
Go to Top of Page
   

- Advertisement -