SQL server agent send email

I set up email notification for a job completes. I configured database mail profile and mail account. This works fine and I can send out test email.
However, the SQL agent couldn't send out email and when I tried to restart the SQL server agent, I got the following errors:
Message
[260] Unable to start mail session (reason: Microsoft.SqlServer.Management.SqlIMail.Server.Common.BaseException: Mail configuration information could not be read from the database. ---> System.InvalidCastException: Unable to cast object of type 'System.DBNull'
to type 'System.Byte[]'.
   at Microsoft.SqlServer.Management.SqlIMail.Server.DataAccess.DataAccessAdapter.GetAccount(Int32 accountID)
   --- End of inner exception stack trace ---
   at Microsoft.SqlServer.Management.SqlIMail.Server.DataAccess.DataAccessAdapter.GetAccount(Int32 accountID)
My SQL server is SQL 2008 with service pack 3.
Anybody has any idea what's the problem is?
Thanks

Hi Ying,
You could try below suggestions.And restart SQL Server Agent.
Please refer:
http://www.developerjoint.com/kb/9363-trouble-with-sql-2005-database-mail.aspx.
Thanks,
Maggie
Please remember to mark the replies as answers if they help and unmark them if they provide no help. This can be beneficial to other community members reading the thread.

Similar Messages

  • Can SQL Server Express Send Emails?

    I am fiddling around with one of my SQL Server Express instances, and I'm trying to get it to send me an email.  I just read these links.
    http://execsql.org/configure-send-database-email-sql-server-2012-express-edition
    http://www.databasejournal.com/features/mssql/article.php/3626056/Database-Mail-in-SQL-Server-2005.htm
    I followed all the steps there, and now, as I'm trying to send myself an email, I get this message.
    The mail could not be sent to the recipients because of the mail server failure. Exception Message: Could not connect to mail server.
    When I run this:
    SELECT * FROM msdb.dbo.sysmail_event_log;
    I see this:
    description
    The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 1 (2015-01-21T14:25:36). Exception Message: Could not connect to mail server. (The requested name is valid, but no data of the requested type was found).
    Any idea what's wrong?  Can SQL Server Express even send emails???
    Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

    Hello,
    You can make use of CLR Integration for sending email from SQL Server Express.
    http://www.sqlservercentral.com/articles/SQL+Server+Express/71341/
    http://www.vnypatel.com/sending-emails-with-clr-sql-server-express-editions
    SQL Server Express does not support database mail.
    https://msdn.microsoft.com/en-us/library/cc645993.aspx
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

  • Sql server agent alert is not sending a mail

    1. sql server agent alert is not sending a mail .I have configure it for sql server event alert and error number 14151 and in "Raise alert when messaging contains" check box I have set: Replication Distribution Subsystem: agent
    2. Sql server agent is restarted also.All database mail and other settings are Ok.
    Still I m not getting mail
    Thanks

    Hi Ajay,
    You can test the connectivity with any server who has smtp access and execute osql to send email to required people.
    Below command can be put into bat file and named as DB_MirrorAlert.bat
    osql -U XXXX -P XXXXX -S Test123 -h-1 -s "|" -w 50 -n -i E:\DBscript_Santosh\DB_MirrorAlert.sql > E:\DBscript_Santosh\DB_MirrorAlert.csv
    OR
    osql -E -S Test123 -h-1 -s "|" -w 50 -n -i E:\DBscript_Santosh\DB_MirrorAlert.sql > E:\DBscript_Santosh\DB_MirrorAlert.csv
    In above command, you are connecting to a server where db email works fine for you and then you are executing a script wherein you can put alert for success or failure like below:
    Success Alert:
    Create a success alert file named as DB_MirrorAlert.sql as you are calling above in bat file and put all scripts in one folder.
    use master
    Go
    EXEC msdb.dbo.sp_send_dbmail
        @profile_name='Profile One',
    @recipients =
    XXX,
    @subject  = 'DB Mirror Server Failed over',
    @body = '
    'DB Mirror Server Failed over to Server B'
    Now you can do this after checking that any one of the server is  not responding or by checking system store procedures too. Good link about monitoring is mentioned below:
    http://msdn.microsoft.com/en-IN/library/ms190030.aspx
    Let me know if you need any more assistance at my end.
    Santosh Singh

  • SQL Server Agent Job Failing on Job Step

    Hi,
    Firstly, apologies if this post has been made in the wrong group.  Running SQL Server 2012.  I'm attempting to add a SQL Server Agent Job which calls a stored procedure that sends a Database Mail message.  The SQL Server and SQL Server Agent
    both run under the NT AUTHORITY\NETWORK SERVICE account.  The Database Mail service has been enabled, and a public profile created.  When running the stored procedure manually, I receive no errors - everything runs as expected and I do receive an
    email containing the expected information.
    I've created the job, job step, job schedule, attached the schedule to the job, and assigned the job to server, all using T-SQL without error.  I've also enabled the mail profile on the SQL Server Agent, and I know that part is working because when
    the job fails, I get an email notification of the failure.
    I've checked the command text in the job step and parsed it within the SQL Job Step Edit window to confirm, it shows as parsing correctly.  However, when I manually run the job itself, I get the following:
    Execution of job failed.  See the history log for details.
    I check the history log and it shows:
    [474] Unable to refresh Database Mail profile Database Mail Profile. (reason: ) (Not a typo, the history log shows no reason)
    [260] Unable to start mail session.
    [396] An idle CPU condition has not been defined - OnIdle job schedules will have no effect
    The command text on the failing job step is as follows:
    DECLARE @date [varchar](10)
    SET @date = CAST(GETDATE() AS [varchar](10))
    EXEC [dbo].[GetExceptions]
    @company = 'MyCompany',
    @checkDate = @date
    With regard to the date value being passed as varchar: This stored procedure is used to check for exceptions against multiple databases on this server (hence the company parameter) via dynamic SQL.  I'd much prefer to use proper data typing but this
    is the only way I could get it to work.
    Does anyone have any suggestions on anything else I could check, or insights into why this is failing?  Any help is greatly appreciated!
    Best Regards
    Brad

    I am not sure if this really helps but I would do follow the below steps:
    1. make sure sql server agent has database mail enabled(rigt click on server agent--properties--alert system--enable database mail and choose right profile.) and RESTART THE SQL SERVER AGENT.(i know you said it i working, but sometimes,  restart the
    sql server agent might fix)
    2. check agent error log and check if any error messages.
    3. run the command text you mentioned in sql server and see if it is working.(i know you said it is working but just to make sure).
    4. make sure sql server agent service user has permissions to run database mail in msdb. check this https://msdn.microsoft.com/en-us/library/ms186358.aspx
    5. Check the output from select * from msdb.dbo.sysmail_log and if it says anything
    6.it does not look like the job log is getting truncated but to make sure, get the job step output to a text file.to do this, edit the job step and on the job step properties click on advanced,  enter path to the output file. this will give the complete
    output for the step.
    Hope it Helps!!

  • Database Mail not working with SQL Server Agent

    I'm running SQL Server 2005 Standard edition 64 bit with SP2 on a 64 bit machine. 
    Database mail does not work with SQL Server Agent.  When I configure SQL Server Agent to use database mail the test email button is greyed out and inactive therefore I cannot send emails using operators or for jub success failure etc. 
    I've read that there was supposed to be a fix for this with SP1 but I have SP2 and still receive the same problem.  Please can somebody help as I do not wish to use SQL Mail as a work around due to this becomming redundant in future versions of SQL Server.
    Kind Regards

    The problems solved
    steps:
    1)we create a mail profile at at Managment->Database Mail ,of SQL Managment
    2)we set this account as "default" at Managment->Database Mail -> Configure Database Mail -> Manage profile security
    3)At tab "Alert System" of SQL Server Agent properties , we check the "Enable mail profile" , Mail System=Database Mail, Mail profile = "the profile we already create"
    4)we create a new operator at "Operators" of sql agent, where at "notification options" -> "Email name" we put the mail where we want to sent the agent the mails at failured job
    5)We go at a specific job, at tab "Notifications" ,we check the "email" check box and then we choose the operator we just create, at the text box next to check box.
    I hope not to forget something
    Thank You all for the help

  • Management Studio Fails when added Integration Services step to SQL Server Agent Job

    Hi,
    I have two new servers I've setup with Windows Server 2012, SQL Server 2012 SP1, Visual Studio 2012 SP4. I've previously been on SQL 2008 and VS 2008 so this is new to me.
    I am finding SSMS is throwing an exception on both machines when i do the following:
    1. Go to SQL Server Agent | Jobs
    2. Create a new Job.
    3. Select Steps and click New Step
    4. Change the job type to SQL Server Integration Services Package.
    Following error occurs:
    TITLE: Microsoft SQL Server Management Studio
    The type initializer for '<Module>' threw an exception. (SqlManagerUI)
    ADDITIONAL INFORMATION:
    The C++ module failed to load.
     (DTEParseMgd)
    Index was outside the bounds of the array. (DTEParseMgd)
    I also find if I take an existing job with SSIS package steps and attempt to edit those steps the same message appears. This issue happens on both my servers as they have been configured almost identically. This doesn't occur when selecting any other job
    type.
    I've also tried installing cumulative update 8 in a hope that this may fix it but with no success.
    As my entire environment is based around SQL Agents running SSIS i'm a little bit concerned, especially since I have some tight deadlines getting these servers running.
    I have found nothing relating to this issue. Any help greatly appreciated.
    Simon
    Below is the detailed error message:
    ===================================
    The type initializer for '<Module>' threw an exception. (SqlManagerUI)
    Program Location:
       at Microsoft.SqlServer.Management.SqlManagerUI.DTSJobSubSystemDefinition.Microsoft.SqlServer.Management.SqlManagerUI.IJobStepPropertiesControl.Load(JobStepData data)
       at Microsoft.SqlServer.Management.SqlManagerUI.JobStepProperties.UpdateJobStep()
       at Microsoft.SqlServer.Management.SqlManagerUI.JobStepProperties.typeList_SelectedIndexChanged(Object sender, EventArgs e)
       at System.Windows.Forms.ComboBox.OnSelectedIndexChanged(EventArgs e)
       at System.Windows.Forms.ComboBox.set_SelectedIndex(Int32 value)
       at System.Windows.Forms.ComboBox.set_SelectedItem(Object value)
       at Microsoft.SqlServer.Management.SqlManagerUI.JobStepProperties.InitializeStepCombo()
       at Microsoft.SqlServer.Management.SqlManagerUI.JobStepProperties.InitializeData()
       at Microsoft.SqlServer.Management.SqlManagerUI.JobStepProperties.OnInitialization()
       at Microsoft.SqlServer.Management.SqlMgmt.ViewSwitcherControlsManager.SetView(Int32 index, TreeNode node)
       at Microsoft.SqlServer.Management.SqlMgmt.ViewSwitcherControlsManager.SelectCurrentNode()
       at Microsoft.SqlServer.Management.SqlMgmt.ViewSwitcherControlsManager.InitializeUI(ViewSwitcherTreeView treeView, ISqlControlCollection viewsHolder, Panel rightPane)
       at Microsoft.SqlServer.Management.SqlMgmt.LaunchForm.InitializeForm(XmlDocument doc, IServiceProvider provider, ISqlControlCollection control)
       at Microsoft.SqlServer.Management.SqlMgmt.LaunchForm..ctor(ISqlControlCollection control, IServiceProvider provider)
       at Microsoft.SqlServer.Management.SqlManagerUI.JobSteps.editJobStep_Click(Object sender, EventArgs e)
       at System.Windows.Forms.Control.OnClick(EventArgs e)
       at System.Windows.Forms.Button.OnClick(EventArgs e)
       at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
       at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ButtonBase.WndProc(Message& m)
       at System.Windows.Forms.Button.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
       at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.RunDialog(Form form)
       at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
       at System.Windows.Forms.Form.ShowDialog()
       at Microsoft.SqlServer.Management.SqlMgmt.RunningFormsTable.RunningFormsTableImpl.ThreadStarter.StartThread()
    ===================================
    The C++ module failed to load.
     (DTEParseMgd)
    Program Location:
       at <CrtImplementationDetails>.LanguageSupport.Initialize(LanguageSupport* )
       at .cctor()
    ===================================
    Index was outside the bounds of the array. (DTEParseMgd)
    Program Location:
       at _getFiberPtrId()

    Hi,
    I hadn't installed CU3 however as a test i tried installing CU4 and this didn't help. Since my first emails i have more issues that have brought a complete hault to the upgrade project.
    If i double click on a package to run it manually I basically get the same issue. This means i have no way of running any packages except throught VS.
    I've also found that regardless of the order of the software installs it still fails. It's related to SP1 of SQL and SP4 of VS.
    I'm on Server 2012. When install in the following order SQL 2012, SQL SP1, VS2012, BIDS, VS SP4 i have no problem until VS SP4 is installed. If i install VS SP4 then BIDS it also fails at the last step. If i install all the VS and BIDS software first, then
    SQL then SQL SP1 it fails at the SQL SP1 step.
    This means i could actually install everything and either ignore the SQL SP1 or the VS SP4 and i'd be fine however this is not really a solution as i will never be able to patch the software and once live this is very dangerous.
    I am still surprised there is no obvious solution to this. I'm only installing MS software on a fresh box and only installing 5 pieces of software (including the SPs). I would have though if this was an issue others would have come across it too.
    Has anyone else installed all these components and got them working on the same OS. I believe early on in my testing i installed these in Windows Server 2008 and didn't have the issue.
    Regards.
    Simon.

  • SQL Server Agent Job steps

    I've searched and can't find the answer to this, would like to post it in the appropriate forum. (Using SQL Server 2008R2) I'm having trouble with a long string of email addresses in one of my SQL Server Agent Jobs. I'd like to edit it for readability but
    can't find a way to do it. Currently smashing all the addresses together works,  The job executes and returns the correct data and sends the desired emails, but if I try a continuation character it sends emails to the first person on the list, then no
    others.
    It works fine when all the email addresses have to be in one long string with no spaces. (Example below) Hard to read/edit.
    ,@recipients ='[email protected];[email protected];[email protected];[email protected];[email protected];[email protected];[email protected];[email protected];[email protected];[email protected];[email protected];[email protected];[email protected]'

    Prashanth, This runs every two hours five days a week for the last two years. The only problem I have with it is that the line of email addresses is difficult to read and edit when employees leave and are replaced. 
    Thanks for looking at this for me - We like it because it's easy for smart phone users to read when they're out and about. EDITED TO ADD: Although this interface wraps the address line, in Microsoft's SQ: Server Agent, the line just stretches off to the
    right apparently infinitely.  DietSquirt
    --Query for updates to QC db mail
    --Delivers results in body of email
    SET NOCOUNT ON;
    use QC 
    Declare @bodytext nvarchar(150)
    exec msdb.dbo.sp_send_dbmail
    @profile_name = 'Send Mail'
    ,@recipients ='[email protected];[email protected];[email protected];[email protected];[email protected];[email protected];[email protected];[email protected];[email protected];[email protected];[email protected];[email protected];[email protected]'
    ,@reply_to = [email protected]'
    ,@subject = 'Updates to QC - ALL LOCATIONS'
    ,@execute_query_database = QC
    ,@attach_query_result_as_file  = 0
    ,@query_result_header= 0
    , @query_result_no_padding = 1
    ,@query_result_width = 6500
    ,@query_result_separator = '    '
    ,@query =
    SET NOCOUNT ON
    declare @startdate datetime
    ,@enddate datetime
    ,@Location nvarchar(20)
    set @startdate = DATEADD (hour , -12 , GETDATE() )
    set @enddate = GETDATE()
    select
     '' Updates to QC''
    select
    [The main query goes here]

  • Database Mail Fails For SQL Server Agent Jobs / Maintenace plans - Why ?

    Database Mail Fails For SQL Server Agent Jobs / Maintenace plans - Why ?
    This has been a very common question I have seen relatedt to Database mail and I thought will post here so if you run into this issue, it could be due to one of the following and also have mentioned below how to get around them. Bottom line is datbase mail works fine with SQL Agent jobs and maintenace plans in SP1 on all platforms.
    1. If you see this on 64 bit platform and on RTM build, this is a bug that is addressed in SP1.
    2. If you see the below error message, it is known issue and this is because of design that requires SQL Agent to restart, if SQL Agent was started before enabling databasemail and setting a new profile. We are evaluating to change this design of not requiring to restart agent for our future release.
    Re: 264] An attempt was made to send an email when no email session has been established
    This problem will go away after restarting SQL Server Agent in this case. Thanks,
    Gops Dwarak, MSFT

    This may be related to the fact that DBMail, by default, shuts itself down after 10 minutes of inactivty.  If the mail service isn't running, you won't be able to queue up any mail messages.
    There may be a built-in mechanism for addressing this problem, but I found that I can detect this situation and start the mail listener before sending db mail.  I use the following in stored procs that need to send email.
    You could increase the inactivity period for db mail shutdown from 600 seconds to some larger value.  It might not make sense to do so, since shutting it down releases its resources back to teh system; if your SQL server only sneds mail infrequently, it might be better to start the mail listener on demand.  Someone with more experience than I might want to add their two cents' worth.  :-)
    /* Check the mail engine. Start the service if is is stopped         */
    /* -- the DB Mail engine shuts down after 10 minutes (of inactivity) */
    /* -- this setting can be changed, but we probably don't need to.    */
    DECLARE @rc INT
    IF NOT EXISTS (SELECT * FROM msdb.sys.service_queues
                   WHERE name = N'ExternalMailQueue' AND is_receive_enabled = 1)
        EXEC @rc = msdb.dbo.sysmail_start_sp
        -- TODO: add handling and logging for any engine start issues

  • Error while executing SSIS package which contains Script component through SQL Server Agent Job

    Hello All,
    I have written one SSIS 2012 package which is fetching records from CSV and put it into staging DB and from staging DB , using SSIS script component task, I am inserting data into Dynamics CRM. So far it is working fine when
    I manually execute SSIS package.
    but when I run the SSIS package using SQL server agent job, I encounter below error. After seeing below error at step "Insert TLM Headers Script Component " I understand that it is failing at script component which I have used in SSIS package,
    but I am not sure what is the cause behind that? please advise.
    Error:
    Executed as user: domain\user account. Microsoft (R) SQL Server Execute Package Utility  Version 11.0.5556.0 for 64-bit  Copyright (C) Microsoft Corporation. All rights reserved.    Started:  1:21:41 PM  Error: 2015-02-25
    13:21:45.94     Code: 0xC0047062     Source: Insert TLM Headers Script Component [205]     Description: System.ServiceModel.FaultException: The server was unable to process the request due to an internal
    error.  For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the <serviceDebug> configuration behavior) on the server in order to send the exception information back to
    the client, or turn on tracing as per the Microsoft .NET Framework 3.0 SDK documentation and inspect the server trace logs.    Server stack trace:      at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message
    reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter)     at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)    
    at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)     at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage
    methodCall, ProxyOperationRuntime operation)     at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)    Exception rethrown at [0]:      at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.HandleUserException(Exception
    e)     at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.ProcessInput(Int32 inputID, PipelineBuffer buffer)     at Microsoft.SqlServer.Dts.Pipeline.ManagedComponentHost.HostProcessInput(IDTSManagedComponentWrapper100
    wrapper, Int32 inputID, IDTSBuffer100 pDTSBuffer, IntPtr bufferWirePacket)  End Error  Error: 2015-02-25 13:21:45.94     Code: 0xC0047022     Source: Insert TLM Headers SSIS.Pipeline    
    Description: SSIS Error Code DTS_E_PROCESSINPUTFAILED.  The ProcessInput method on component "Script Component" (205) failed with error code 0x80131501 while processing input "Input 0" (215). The identified component returned an error
    from the ProcessInput method. The error is specific to the component, but the error is fatal and will cause the Data Flow task to stop running.  There may be error messages posted before this with more information about the failure.  End Error 
    DTExec: The package execution returned DTSER_FAILURE (1).  Started:  1:21:41 PM  Finished: 1:21:45 PM  Elapsed:  4.009 seconds.  The package execution failed.  The step failed.
    Thanks
    Pankaj

    domain\user account has not proper rights
    That being said, often SSIS jobs require a proxy to be runnable and this is how you make one up
    http://www.mssqltips.com/sqlservertip/2163/running-a-ssis-package-from-sql-server-agent-using-a-proxy-account/
    Arthur
    MyBlog
    Twitter

  • SQL Procedure working when run manually, not running from sql server agent

    I have a procedure that runs fine using the execute command in SSMS, however putting the same command in a job gives the following error.
    line 9, character 9, unexpected end of input
    The code takes a very long XML string in UTF-8 encoding and puts it into a single nvarchar(max) cell. Then puts this string into a XML cell in a different table, allowing me to query the individual parts of the XML code using the nodes function. I cannot put
    the data directly into a nvarchar cell due to encoding differences.
    I can't reproduce the string here as it is very very long.
    I'm just looking for ideas really as to where it might be going wrong.
    Here is what I know so far:
    The procedure runs without issue when executed manually
    I have checked permission issues, and that doesn't seem to be the problem. The agent runs under my own account and I am a sysadmin on the database
    I split the procedure into seperate parts to locate exactly where the problem is occuring. Once again the seperate procedures run fine when executed manually but an error occurs when run through SQL Server agent.
    When the query is run seperately through SQL Server Agent it gives a slightly different error. This leads me to believe it is an encoding issue. However I am getting the XML from a webpage and I can't change the encoding on the webpage.
    line 1, character 38, unable to switch the encoding
    I know this is a long shot since you can't replicate the issue but if anyone could give an idea as to where to start looking for an answer, it would be greatly appreciated.

    Here's how I'm taking the XML data and putting it into an nvarchar(max) column (Column Name TEXT):
    Select @url = 'http://....'
    EXEC @hr=sp_OACreate 'WinHttp.WinHttpRequest.5.1',@win OUT
    IF @hr <> 0 EXEC sp_OAGetErrorInfo @win
    EXEC @hr=sp_OAMethod @win, 'Open',NULL,'GET',@url,'false'
    IF @hr <> 0 EXEC sp_OAGetErrorInfo @win
    EXEC @hr=sp_OAMethod @win,'Send'
    IF @hr <> 0 EXEC sp_OAGetErrorInfo @win
    INSERT #TextData(TEXT)
    EXEC @hr=sp_OAGetProperty @win,'ResponseText'
    IF @hr <> 0 EXEC sp_OAGetErrorInfo @win
    EXEC @hr=sp_OADestroy @win
    IF @hr <> 0 EXEC sp_OAGetErrorInfo @win

  • Sql server agent job with SSIS

    Hello Experts
    i have a sql server agent job that has four steps in tsql,ssis,tsql and tsql orders. the job run automatically every night and i copy paste the error message right here, any ideas please:
    Date                     
    1/27/2014 7:30:00 AM
    Log                        
    Job History (test [Mon-Fri AM])
    Step ID                
    1
    Server                  
    server1
    Job Name                           
    name [Mon-Fri AM]
    Step Name                        
    step one
    Duration                             
    00:34:33
    Sql Severity                       
    0
    Sql Message ID                
    0
    Operator Emailed                           
    Operator Net sent                          
    Operator Paged                               
    Retries Attempted                         
    0
    Message
    Executed as user x\serveragent. The step was cancelled (stopped) as the result of a stop job request.

    you can try default trace / event viewer to check if there is any entry on same .
    How to read default trace in sql server
    Thanks Saurabh Sinha
    http://saurabhsinhainblogs.blogspot.in/
    Please click the Mark as answer button and vote as helpful
    if this reply solves your problem

  • Starting SQL Server Agent service

    I have a brand new 64-bit laptop and have installed both SQL Server 2014 and SQL Server 2012sp1, but neither instance is able to start its SQL Sever Agent Service.  The error is 1053:  'The service did not respond to the start or control request
    in a timely fashion'. Googling that message does not seem to give helpful step by step solutions. Please help.
    Dave Juergens
    [email protected]
    Dave Juergens

    could you tell us your sql server edition - if it is EXPRESS edition - it does not comes with SQL Server agent. you will sql server agent service in configuration manager but it does not start because the feature is not available.
    you can find the sql edition using. select @@version
    and post the output here
    if it is not Express edition, could you please check the error log or event viewer and if there is more detailed information on the error.
    Hope it Helps!!

  • Manage SQL Server Agent Jobs

    What is the best way to manage SQL Server Agent Jobs?
    Requirement: If any job fails I need an entry(log) to be done in a table.
    Please use Mark as Answer; if my reply solved your problem. Use Vote As Helpful if a post was useful. |WWW.FACEBOOK.COM/SONNIE.HIM | |+91-9742-354-384 |

    Thanks all,
    I went through all the links except provided by
    Tom Phillips, couldn't open it. The thing is that I know results of a Agent job are stored in a table and I can create a SSRS report too and subscribe it to myself or I can use these system tables as a source for my destination table (as asked in the question)
    and create a job to run that code every (so) minutes. But what if the subscription to that report got failed due to network error and what if the job which is managing other jobs, itself fails.
    Is there any full proof idea which I can implement. My client has 2008 R2 installed.
    I have created an object termed as Alerts_FollowUp which I use for sending SMS to respective owner including me. The idea is to make an entry into a table with job name and status. If it status is failed then via Job name I can pick the owner name and number
    stored in my master table and have an entry done in the Alerts_FollowUp. After this using FIORANO I am sending these records to a telecom lease line network which are sending my texts to the respective mobile numbers.
    I believe the provided explanation was necessary and sufficient.
    Please use Mark as Answer; if my reply solved your problem. Use Vote As Helpful if a post was useful. |WWW.FACEBOOK.COM/SONNIE.HIM | |+91-9742-354-384 |

  • SQL Server Agent Jobs- Not running

    Team,
    We have a production database hosted on SQL Server 2008R2 SP2(10.50.4000). We have application jobs which are scheduled and basically have packages called from this job. These jobs were running all good till yesterday and it has stopped working since yesterday
    even though its enabled. Manual runs are successful. Other jobs are running fine. 
    Checked the Owner of these jobs and the account is SQL Server account which is a proxy account. It had enforce password policy. I have removed that and reset the password to original. However it didnt work.
    The last change on this server was windows patching which was performed last week. Apart from that the SQL Server agent service was changed. This is a clustered environment.
    The last resort is restart the agent, however would like to get some inputs before I perform this action. 
    Please let me know your valuable inputs.
    Regards,
    Sharath

    If job is not executed at all, that is, there are no entries in the job history, check:
    1) The job is enabled.
    2) The schedule(s) is enabled.
    3) The scdedule does not have an end date has has passed.
    4) And that all other conditions on the schedule says that the job should run.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Sql server agent not work

    hi every one ,
    i use sql server agent to make a job which delete some rows from my table at 12:00 AM
    this job works on (Mydatabase1) but when i make another job to another database(Mydatabase2)
    i get this error from ViewJob HIstory :
    Myjob2,Error,1,FATMA\MSSQLSERVER2008,Myjob2,step2,,Executed as user: NT AUTHORITY\SYSTEM. DELETE
    failed because the following SET options have incorrect settings: 'QUOTED_IDENTIFIER'. Verify that SET options are
    correct for use with indexed views and/or indexes on computed columns and/or filtered indexes and/or query
    notifications and/or XML data type methods and/or spatial index operations. [SQLSTATE 42000] (Error 1934).  The step
    failed
    please inform me what is that error means?and how can i fix it?and why this job work to database and not work for another!!!
    best wishes
    fatma
    fatma mohamed

    Hi Miloslav Peterka,
    i set Quoted Identifiers to true it was false,it woorked in first time after that i get this error(but in my worked job on myDatabase1 the Quoted Identifiers was false.)
    Date  24-05-2010 10:44:28 ص
    Log  Job History (AttendanceJob)
    Step ID  0
    Server  FATMA\MSSQLSERVER2008
    Job Name  AttendanceJob
    Step Name  (Job outcome)
    Duration  00:00:01
    Sql Severity  0
    Sql Message ID  0
    Operator Emailed  
    Operator Net sent  
    Operator Paged  
    Retries Attempted  0
    Message
    The job failed.  The Job was invoked by User sa.  The last step to run was step 1 (attStep).
    wat is the reason of that error?
    best wishes
    fatma mohamed

Maybe you are looking for