SQL Server Job

The SharePoint Admin before me was experiencing many issues with SQL Server 1 and SQL Server 2. The main issue was when SQL1 went down and during the failover process was having trouble failing over to SQL2. Any issues during the failover process were resolved,
on the way back to SQL1. New hardware resolved a lot of the issues says the company, but now are requesting the timer changed from 15 minutes to 1 minute or 2 minutes. I have no idea where to look. Any ideas? It would be a great help! 
If someone could give me more insight to what this all actually means would be very helpful, I, myself don't know what this all means. 

On one of the SQL boxes, it will be listed under Control Panel -> Administration Tools. It may be named slightly different depending on the version of Windows you're running.
If you're asking about common issues with any SharePoint updates, generally they just fail when running the Config Wizard. I usually just retry running it to start with, then investigate issues in the ULS logs if it fails again.
Trevor Seward
Follow or contact me at...
&nbsp&nbsp
This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

Similar Messages

  • What is the commands for SQL server job to ftp file to remote server?

    I created the job to bcp data out and create file on file system. after that, I need to ftp the file over to another box. how can I do it from sql server job?
    JulieShop

    I would like to suggest a SSIS package with a
    FTP Task instead.
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • SQL Server jobs fail if I signout the Remote Desktop connection

    I have some SSIS jobs running in the production server which we usually take that server by Windows' Remote Desktop Connection to monitor the jobs. The problem in our case is If we sign out the server in remote connection, all the sql server jobs getting failed
    until we reestablish a remote connection but the jobs work fine if we close the remote connection explicitly by the (x) mark on the Remote Connection interface
    Any idea on this issue

    always same error like the following
    Code: 0xC0014009     Source: Connection manager "Invoice"     
    Description: There was an error trying to establish an Open Database Connectivity (ODBC) connection with the database server.  End Error  Error: 2015-01-12 08:00:05.26     Code: 0x0000020F     Source: DFT GetData  [2]  
    Description: The AcquireConnection method call to the connection manager Invoice failed with error code 0xC0014009.  There may be error messages posted before this with more information on why the AcquireConnection method call failed.  End Error  Error:
    2015-01-12 08:00:05.26     
    Code: 0xC0047017     Source: DFT GetData SSIS.Pipeline     
    Description:  Data failed validation and returned error code 0x80004005.  End Error  Error: 2015-01-12 08:00:05.27     
    Code: 0xC004700C     Source: DFT GetData SSIS.Pipeline     
    Description: One or more component failed validation.  End Error  Error: 2015-01-12 08:00:05.28     
    Code: 0xC0024107     Source: DFT GetData      
    Description: There were errors during task validation.  End Error  DTExec: The package execution returned DTSER_FAILURE (1).  Started:  8:00:00 AM  Finished: 8:00:06 AM  Elapsed:  5.678 seconds.  The package execution
    failed.  The step failed.

  • Firing SQL Server Job Through Java

    Hi All
    How can I fire a SQL Server Job from Java. I am from data warehousing background and new to java. I process my cubes though a package in DTS and have encapsulated the package in a job.
    I can connect to the SQL Server where the package & job reside.
    Regards
    Abhinav

    Can it be called like a stored procedure? If so (and probably it can) look into CallableStatement... a good first step would be to see how to run it through SQl statements in an admin tool (like QueryAnalyzer) to see how it can be invoked.
    If it can be invoked through SQL at all you can call it in Java. Also be aware of permission issues.

  • SQL Server Job Monitoring

    Hi,
    I am looking at implementing Grid Control monitoring on our SQL Server estate.
    One of the items we need to monitor for is SQL Server jobs which have failed (including job name and date).
    Does anyone have an idea of how this can be done. I'm sure I must be missing a trick here as it would seem strange that this information is being collected but can't be put into a metric or notification.
    Any assistance or pointers greatly appreciated!

    Could you please clarify what exactly is your question and what phase are you in implementing monitoring SQL Server usign Grid Control?
    Are you just about to install the plug-in for SQL Server or you are already trying to configure monitoring SQL Server jobs? I'm asking this because you mentioned "I am looking at implementing Grid Control monitoring on our SQL Server estate." which implies you are just planning to implement.
    Try reading metalink note 367797.1. You'll find lots of information and other metalink notes which may resolve your problem.
    If you can clarify your exact problem, the better.

  • Sql server job is succeeding even though it should fail

    Hi,
    I created a sql server job with one job step for a SSIS package using Powershell.
    When I run the job (manually), it shows "success" state, but it should fail (because of the bad configuration parameters).
    But if I go to job properties, and then edit job step properties (don't have to make any changes here, just clicking ok button is enough)
    then the job run will fail as expected.
    I am not sure why it is not failing first time?
    Any help is appreciated.
    Thanks
    -Bhargavi

    I set "QuitWithFailure" option for the 'OnFailAction' of the job.
    $jobStep.OnFailAction = "QuitWithFailure" 
    Here is the code:
           write-Host ""
            Write-Host "Create job for $tenantid"
            $jobName = "Auto-"+$tenantid
            $job = New-Object Microsoft.SqlServer.Management.SMO.Agent.Job($server.JobServer,$jobName)
             #Delete the job if it already exists
            if($Server.JobServer.Jobs.Contains($jobName))
                 write-host "Deleting job $jobName"             
                $sqlCommand.CommandText = "EXEC msdb.dbo.sp_delete_job @job_name = N'$jobName', 
               @delete_unused_schedule=1;"
                $result = $sqlCommand.ExecuteNonQuery()               
            $job.Create()
            #Create job step
            Write-host "Creating job step for $jobName"
            $jobStep = New-Object Microsoft.SqlServer.Management.Smo.Agent.JobStep($job, $jobName)
            $jobStep.Subsystem= [Microsoft.SqlServer.Management.Smo.Agent.AgentSubSystem]::SSIS                                                                                                                                     
            $jobStep.Command = "/ISSERVER \SSISDB\"+$ssisFolderName+"\"+$ssisProjectName+"\Test.dtsx"+" /SERVER "+$instanceName
            $jobStep.OnSuccessAction = "QuitWithSuccess"
            $jobStep.OnFailAction = "QuitWithFailure"     
            $jobStep.Create()
            $job.ApplyToTargetServer($instanceName)
            $job.StartStepID =$jobStep.ID
            $job.Alter()

  • Alternative step on Biztalk "terminator" process, regarding disabling all sql server jobs prior to running.

    I am getting errors in one of the BT jobs, they recommend running a terminator tool available from MS ... One of the requirements is to disable all the sql server jobs, my question is: Can I just stop the sql server agent? Or this won't do it ....
    Thanks
    Bico Bielich

    Hi,
    I assume that you are talking about issue identified by Monitor BizTalk Server job.
    Why you want to stop the sql server agent? There could be other Non-BizTalk jobs running too.
    You just need to make sure that you have a BizTalk Backup of your databases, all the BTS hosts have been stopped,
    BTS SQL Agent jobs have been disabled.
    Refer: 
    http://blogs.msdn.com/b/biztalkcpr/archive/2011/02/10/using-biztalk-terminator-to-resolve-issues-identified-by-biztalk-msgboxviewer.aspx
    Pls follow the link and perform action based on the respective issue reported by the
    Monitor BizTalk Server job.
    Rachit

  • Executing SSIS packages through SQL Server Jobs.

    Hi,
    I have an SSIS package which generates xml and text files and ftps it to an ftp site. When i run the package from BIDS it works successfully but when i run it from a job it fails. My SSIS package connects to DB server A and though i'm creating a job on DB
    server A but my folder structure and the package resides in server B from where i'm connecting to DB server A through Management Studio. I'm using File system in SQL server Agent Job to call the package. When i execute the job i get following error:
    Executed as user: I\A. ...er Execute Package Utility  Version 9.00.3042.00 for 64-bit  Copyright (C) Microsoft Corp 1984-2005. All rights reserved.    Started:  5:08:05 PM  Error: 2011-06-21 17:08:05.11         
    Description: Unable to load the package as XML because of package does not have a valid XML format. A specific XML parser error will be posted.  End Error  Error: 2011-06-21 17:08:05.11         Description:
    Failed to open package file "E:\P\H\R\Tools\R\R\R.dtsx" due to error 0x80070003 "The system cannot find the path specified.".  This happens when loading a package and the file cannot be opened or loaded correctly into the XML document. This can be the
    result of either providing an incorrect file name was specified when calling LoadPackage or the XML file was specified and has .  The step failed.
    Could you please tell me where am i going wrong?
    Thanks,
    Deepti
    Deepti

    Hi Christa Kurschat,
    I'm running the job under proxy account. And that account has sysadmin permissions.
    I used following script to create proxy account and run my package under that account:
    I. Create job executor account
    Highlight Security->New Login, say to make login as devlogin, type your password, default database can be your target database.
    Server roles: check �sysadmin�
    User mapping: your target database
    Msdb database: you make sure to include
    SQLAgentUserRole, SQLAgentReaderRole,  SQLAgentOperatorRole
    Then click OK
    II. Create SQL proxy account and associate proxy account with job executor account
    Here is the code and run it the query window.
    Use master
    CREATE CREDENTIAL [MyCredential] WITH IDENTITY = 'yourdomain\myWindowAccount', secret = 'WindowLoginPassword'
    Use msdb
    Sp_add_proxy @proxy_name='MyProxy', @credential_name='MyCredential'
    Sp_grant_login_to_proxy @login_name=' devlogin', @proxy_name='MyProxy'
    Sp_grant_proxy_to_subsystem @proxy_name='MyProxy', @subsystem_name='SSIS'
    III. Create SSIS package
    In MS SQL Server Business Intelligence Development Studio, you use job executor account devlogin to create the SSIS package (DTS) and make sure you can execute this package
    in SQL Server Business Intelligence Development Studio. Compile/build this package.
    IV. Create the job, schedule the job and run the job
    In SQL Server Management Studio, highlight SQL Server Agent -> Start. Highlight Job ->New Job�, name it , myJob.
    Under Steps, New Step, name it, Step1,
    Type: SQL Server Integration Service Package
    Run as: myProxy
    Package source: File System
    Browse to select your package file xxx.dtsx
    Click Ok
    Schedule your job and enable it
    I followed these steps.
    Thanks,
    Deepti
    Deepti

  • SQL Server Job that were written in SSIS packages failed

    could not load package files system because of error 0x80070002. Description: could not find file 'C:\program files\microsoft SQL Server\100\DTS\Binn\. The package could not be loaded. The step failed. I found this error on one of my job configured in
    ssis packages which take a view statement from my production server, which actually is in a cluster environment. Thank you guys

    It's a little difficult to infer what could be happening without having an idea about what the package does. If you can share one or two screenshots of it, it would be great. You will need Business Intelligence Development Studio (BIDS) for SQL 2008 or previous,
    or SQL Data Tools if SQL 2012. Right click over the package in the file system and select "Edit".
    In the meanwhile, let me give some ideas for troubleshooting:
    If your servers are 64bits, be sure your SQL Agent Job step for the SSIS package is running also in 64bits.
    Assuming your package basically takes data from the view and move it to other server, main of the workload should be at read time from the view. Try running the SQL statement that package is issuing and take the time. If the time is still less than
    3 minutes, your package should have more logic/transformations doing other tasks that we will need to look in. If time is much more, maybe you have much more data in the view underlying tables.
    If querying from the view is still so fast, we will need to understand what the package is doing after the initial read.
    HTH
    Please, mark this post as Answer if this helps you to solve your question/problem.
    Alan Koo | "Microsoft Business Intelligence and more..."
    http://www.alankoo.com

  • Running SSIS 2005 in SQL Server Job Agent 2012

    Hi Guys,
    I'm trying to create a job in SQL 2012 that calls an SSIS 2005 package, however i'm getting some issue.  I researched the issue a bit and got this link . The given link suggested to use dtexec as SQL 2012 try to convert it in the memory.
    I used the dtexec  but I'm still getting an issue.
    "Executed as user: NT Service\SQLSERVERAGENT. Microsoft (R) SQL Server Execute Package Utility  Version 9.00.1399.06 for 32-bit  Copyright (C) Microsoft Corp 1984-2005. All rights reserved.    Started:  4:11:19 PM  Error:
    2015-04-13 16:11:26.24     Code: 0xC0012024     Source: OTH Market Exist?      Description: The task "OTH Market Exist?" cannot run on this edition of Integration Services. It requires a higher level edition.  End
    Error  Error: 2015-04-13 16:11:26.24     Code: 0xC0012024     Source: Arcticle CSV Exist?      Description: The task "Arcticle CSV Exist?"
    cannot run on this edition of Integration Services. It requires a higher level edition.  End Error  Error: 2015-04-13 16:11:26.24     Code: 0xC0012024     Source: BV Market Exist?      Description:
    The task "BV Market Exist?" cannot run on this edition of Integration Services. It requires a higher level edition.  End Error  Error: 2015-04-13 16:11:26.51     Code: 0xC002F210     Source: No Input
    Files Email Execute SQL Task     Description: Executing the query "DECLARE @result int;  EXEC @result = security.dbo.spSendEmail  
    @Subject='[GFK Import & Export] - All Input Files Are Missing',  
    @Message ='Processing has been stopped due to missing input files',  
    @ToID =25,   @ccID =0,  
    @Attachment =''" failed with the following error: "Database 'security' does not exist. Make sure that the name is entered correctly.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly,
    It seems that I do need to upgrade my packages to run in SQL 2012 unless if there's another way without upgrading it that would be great.
    I just want to get the confirmation if possible or not
    Many thanks guys.

    Hi Vaibhav,
    I created 2 jobs. the first job calls a simple package that execute a single SQL. It ran
    successfully when I execute the said job using this command 
    DTEXEC /FILE "\"C:\TFS\WDSHE SSIS Packages from DTS\GFK_Test_package.dtsx\"" /DECRYPT stud10 /CHECKPOINTING OFF /REPORTING E
    2nd Job, calls a complex package which contains several execute process tasks. this job fails with the error mentioned at the top.
    Now, I modified the simple package in the first job and add an Execute Process Task.
    I'm started to get an issue
    Message
    Executed as user: NT Service\SQLSERVERAGENT. Microsoft (R) SQL Server Execute Package Utility  Version 9.00.1399.06 for 32-bit  Copyright (C) Microsoft Corp 1984-2005. All rights reserved.    Started:  4:51:57 PM  Error: 2015-04-13
    16:52:01.32     Code: 0xC0012024     Source: Unzip BV ZIP      Description: The task "Unzip BV ZIP" cannot run on this edition of Integration Services. It requires a higher level edition.  End Error  DTExec:
    The package execution returned DTSER_FAILURE (1).  Started:  4:51:57 PM  Finished: 4:52:01 PM  Elapsed:  4.212 seconds.  Process Exit Code 1.  The step failed.
    Have you had a similar issues before?
    I will try to install the SSIS service and see how I go. thanks for the link

  • Permissions needed for sql server job to execute stored procedure on linked server?

    Hi all
    I have a job step which attempts to call a stored procedure on a linked server.
    This step is failing with a permission denied error. How can I debug or resolve this?
    The job owner is sysadmin on both servers so should have execute permission to the database/proc I'm calling, right?
    The error is:
    The EXECUTE permission was denied on the object 'myProc', database 'myDatabase', schema 'dbo'. [SQLSTATE 42000] (Error 229).  The step failed.
    My code is:
    EXEC [LinkedServer].myDatabase.dbo.myProc
    Also tried:
    SELECT * FROM OPENQUERY([LinkedServer], 'SET FMTONLY OFF EXEC myDatabase.dbo.myProc')
    With the same result.
    Any help appreciated.

    The job owner may be sysadmin on the remote server. The service account for SQL Server Agent may not. And it is the latter that counts, since the it the service accounts that logs in and impersonates the job owner. But the impersonation inside SQL Server
    does not count much in Windows, and it is through Windows connection is made to the other site.
    One way to resolve this is to set up a login mapping for the job owner. The login mapping must be for an SQL login on the remote server.
    You can verify the theory, but running this query from the job:
       SELECT * FROM OPENQUERY([LinkedServer], 'SELECT SYSTEM_USER')
    By the way, putting SET FMTONLY OFF in OPENQUERY is a terrible idea. This has the effect that the procedure is executed twice. (Unless both servers are SQL 2012 or higher in which case FMTONLY has no effect at all.)
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Running Cmdexec in SQL Server Job

    Hi Everyone,
    I wanted to run a scripts in a job to clean up my folders in SQL Server 2005. The scripts is as below:
    for /f %%i in ('dir /b /s /AD F:\ASCC_FileStore\CITIntegration') do cscript D:\Scripts\BizTalk\BizTalk_WMI.vbs -maintainfolder "%%i"
    No error was happening when it was executed in a batch file.
    but when I ran it in a SQL job, I got below error:
    %%i was unexpected at this time.
    Could you please give me some advice? Thank you very much.
    regards,
    Oliver

    Hi Oliver_Wang,
    According to your description, if you want to delete files with a SQL Agent job in SQL Server, you can also use xp_cmdshell
     command. Here is a full SQL query that is used for deleting the files.
    ----------------------------------- Enabling the COMMAND SHELL ------------------------------
    --Script to enable the XP_CMDSHELL
    -- To allow advanced options to be changed.
    EXEC sp_configure 'show advanced options', 1
    GO
    -- To update the currently configured value for advanced options.
    RECONFIGURE
    GO
    -- To enable the feature.
    EXEC sp_configure 'xp_cmdshell', 1
    GO
    -- To update the currently configured value for this feature.
    RECONFIGURE
    GO
    ----------------------------------- Deleting the files in ------------------------------------
    -- Suppose we need to delete all .txt files under the path (such as "D:\temp\Testing\")
    xp_cmdshell 'DEL D:\temp\Testing\*.txt'
    Regards,
    Sofiya Li
    Sofiya Li
    TechNet Community Support

  • Sql Server Jobs

    Hello Experts-
    I have a query that mergers data from server1(2008r2) with server2(2012) and updates some data. It uses two different databases in both server, I used to run this manually whenever requested by importing the tables to the 2012 server temporally. Now I have
    been asked to scheduled a job for it. My question is what will be the best way, please advise with the steps, thank you. And we don't have a linked sever between the two, and I am not thinking using the linked server two. Thank you for your help as always.

    >My question is what will be the best way,
    SSIS is the best way.
    Here is the forum:
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/home?forum=sqlintegrationservices
    BOL: "SQL Server Agent Jobs for Packages
    You can automate and schedule the execution of SQL Server Integration Services packages by using SQL Server Agent. You can schedule packages that are deployed to the Integration Services server, and are stored in SQL Server, the SSIS Package Store, and the
    file system. "
    LINK: http://msdn.microsoft.com/en-us/library/ms141701.aspx
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Database Design
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

  • SQL Server Job Notifications Disabled

    Hi All,
    This morning I noticed that my production job notifications are not configured, I used to get the alerts using the same operator before and now suddenly I see all jobs have no notifications set. Is dropping and recreating Jobs remove all Notifications? Also
    when I check the operator properties it says Never e-mailed. Where can I see this history if some body did it manually? I have job alerts in my inbox received last week.
    Swapna

    Hello,
    No need to worry, everything is fine here.
    If a principal is disabled, then it has a red arrow pointing down in the icon, like my "sa" account below. Here you have a red pin icon and this means you can't modify it. Since SQL Server 2014 we can create user defined server role (below "MyUserDefinedServerRole"),
    which wasn't possible in SQL Server 2012 and lower version. As you can see in the screenshot below, user defined roles don't have a red pin and can be modified, while predefined server roles do have a pin:
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • SQL Server Jobs & Schedules

    Good Morning All
    Does anyone know of a script/method of where I can obtain the following SQL Server Agent Job Information: -
    Job Name, Owner, Description, Enabled, Schedule Description, Last Run
    I've just joined another company and I've been tasked with auditing the SQL Servers here as this has never been done before.
    Many thanks
    Please click "Mark As Answer" if my post helped. Tony C.

    --WORK for SQL Server 2000 or later
    -- Get information about all jobs that exists in a specific server or
    -- get information about long running jobs in a specific server.
    -- PLEASE! To retrieve information about long running jobs uncomment the WHERE clause
    -- in the end of file.
    -- Reference:
    http://searchsqlserver.techtarget.com/tip/0,289483,sid87_gci1302809_mem1,00.html
    -- job_state:
    -- 0 = Not idle or suspended, 
            -- 1 = Executing, 
            -- 2 = Waiting For Thread, 
            -- 3 = Between Retries, 
            -- 4 = Idle, 
            -- 5 = Suspended, 
            -- 6 = WaitingForStepToFinish, 
            -- 7 = PerformingCompletionActions 
    SET NOCOUNT ON
    --creating a temporary tables.
    --##tbl_joblist
    IF EXISTS 
    (SELECT 1 FROM tempdb..sysobjects 
    WHERE type = 'U' AND name = '##tbl_joblist')
    DROP TABLE ##tbl_joblist
    CREATE TABLE ##tbl_joblist (
    job_id
    UNIQUEIDENTIFIER NOT NULL,  
    last_run_date
    INT NOT NULL,  
    last_run_time
    INT NOT NULL,  
    next_run_date
    INT NOT NULL,  
    next_run_time
    INT NOT NULL,  
    next_run_schedule_id
    INT NOT NULL,  
    requested_to_run
    INT NOT NULL,  
    request_source
    INT NOT NULL,  
    request_source_id
    sysname NULL,  
    running
    INT NOT NULL,   
    current_step
    INT NOT NULL,  
    current_retry_attempt
    INT NOT NULL,  
    job_state
    INT NOT NULL,
    ServerName
    sysname NULL, 
    JobName
    sysname NULL
    --##tbl_jobs
    IF EXISTS 
    (SELECT 1 FROM tempdb..sysobjects 
    WHERE type = 'U' AND name = '##tbl_jobs')
    DROP TABLE ##tbl_jobs
    CREATE TABLE ##tbl_jobs (
    job_id
    UNIQUEIDENTIFIER PRIMARY KEY, 
    JobName
    sysname
    --inserting data
    --##tbl_joblist
    INSERT INTO ##tbl_joblist 
    (job_id,last_run_date,last_run_time,next_run_date,next_run_time,next_run_schedule_id,requested_to_run,request_source,request_source_id,running,current_step,current_retry_attempt,job_state)
    -- Run it as SA (1), so ‘aaa’ is a dummy login name:
    EXEC ('EXECUTE master.dbo.xp_sqlagent_enum_jobs 1, ''aaa'' ')
    GO
    --##tbl_jobs
    INSERT INTO ##tbl_jobs select job_id, name from msdb.dbo.sysjobs
    --adding server name and job name into ##tbl_joblist from ##tbl_jos
    DECLARE @servername sysname
    SELECT @servername = @@servername
    UPDATE ##tbl_joblist
    SET ServerName = @ServerName, JobName =j.JobName 
    FROM ##tbl_joblist r 
    INNER JOIN ##tbl_jobs j ON r.job_id = j.job_id
    WHERE r.ServerName IS NULL
    --checking for long job running
    SELECT 'Long job running '
    SELECT
    ServerName AS "Server Name", 
    Jobname AS "Job Name",
    last_run_date AS "Last Run Date",
    last_run_time AS "Last Run Time",
    --CAST(LEFT(CAST(last_run_date AS varchar(8)),4) + '/' + SUBSTRING(CAST(last_run_date AS varchar(8)), 5,2) + '/' + RIGHT(CAST(last_run_date AS varchar(8)), 2) + ' ' + CAST(((last_run_time/10000) %100)
    AS varchar) + ':' + CAST(((last_run_time/100) %100) AS varchar) + ':' + CAST((last_run_time %100) AS varchar) AS DATETIME) AS 'Last Run Date & Time',
        job_state AS "Job State",
    CASE job_state
    WHEN 0 THEN 'Not idle or Suspended' 
    WHEN 1 THEN 'Executing' 
           WHEN 2 THEN 'Waiting For Thread' 
           WHEN 3 THEN 'Between Retries' 
    WHEN 4 THEN 'Idle' 
           WHEN 5 THEN 'Suspended' 
           WHEN 6 THEN 'Waiting For Step To Finish' 
    WHEN 7 THEN 'Performing Completion Actions' 
    END AS 'Job State',
    next_run_date AS "Next Run Date",
    next_run_time AS "Next Run Time",
    current_step AS "Current Step",
    current_retry_attempt AS "Current Retry Attempt"
    FROM ##tbl_joblist 
    --For Long Running Jobs
    --WHERE job_state in (0,1,2,3,6,7)
    --AND (CAST(LEFT(CAST(last_run_date AS varchar(8)),4) + '/' + SUBSTRING(CAST(last_run_date AS varchar(8)), 5,2) + '/' + RIGHT(CAST(last_run_date AS varchar(8)), 2) + ' ' + CAST(((last_run_time/10000) %100) AS varchar) + ':' +
    CAST(((last_run_time/100) %100) AS varchar) + ':' + CAST((last_run_time %100) AS varchar) AS DATETIME)) <= DATEADD(HOUR, -2, GETDATE())
    --Cleanup
    DROP TABLE ##tbl_joblist
    DROP TABLE ##tbl_jobs
    GO
    -- Get JobSteps info
    USE [msdb]
    GO
    SELECT
    --j.job_id,
    -- s.srvname,
    j.name,
    js.step_id,
    js.command,
    j.enabled 
    FROM dbo.sysjobs j
    JOIN dbo.sysjobsteps js
    ON js.job_id = j.job_id 
    JOIN master.dbo.sysservers s
    ON s.srvid = j.originating_server_id
    --WHERE js.command LIKE N'%KEYWORD_SEARCH%'
    Regards,
    Edvaldo Castro
    Edvaldo Castro http://edvaldocastro.com MCITP Database Administrator on SQL Server® 2008 MCITP Database Administrator on SQL Server® 2005 MCTS: SQL Server® 2008 MCTS: SQL Server® 2005 MCT: Microsoft Certified Trainer MTA: Microsoft Technology Associate
    MTAC – Microsoft Technical Audience Contributor CCSQLA – Cambridge Certified SQL Associate TOEIC – Test of English for International Communication

  • Conversion Error During the Execution of SQL Server Job

    Hello,
    I have a production SQL server and a test SQL server that mimics the production server. On the production server all the jobs which do a variety of things using Transact SQL and SSIS packages work flawlessly. However one of the jobs on the test server fails
    at a step and issues the following error:
    executed as user: DomainName\administrator. Conversion failed when converting datetime from character string. [SQLSTATE 22007] (Error 241). 
    The step failed.
    Here is the code contained in the steps Command window (same exact code that works fine on the production server):
    declare @Now datetime
    declare @DB_Date datetime
    declare @Trip_Err datetime
    select @Now = convert(varchar,getdate(),101)
    select @DB_Date = (select convert(varchar,max(ProcessDate),101) from I_Loans)
    if @now <> @DB_Date
    begin
    truncate table I_Loans
    end
    else
    select @Trip_err = 'error'
    I don’t see anything preventing this code from executing. However, I am not a programmer. My SQL Server version is below:
    Microsoft SQL Server 2005 - 9.00.5324.00 (Intel X86)  
    Aug 24 2012 14:24:46   Copyright (c) 1988-2005 Microsoft Corporation 
    Standard Edition on Windows NT 6.0 (Build 6002: Service Pack 2)
    Any advice or solutions will be greatly appreciated. Please let me know if I need to provide more information.
    Thank you,
    Dave
    David Young

    Could you run this query from management studio in test?
    select convert(varchar,max(ProcessDate),101) from I_Loans
    It could be something to do with the ProcessDate value which had issues to convert
    Regards, Ashwin Menon My Blog - http:\\sqllearnings.com

Maybe you are looking for

  • Account group and Account Type.

    Hi all, Could you please tell me the diferences between <b>GL Account group</b>  (<i>by example cash, expense, revenue</i> ....) which we define in IMG - Financial Accounting - General Ledger Accounting - G/L Accounts - Master Records - Preparations

  • Sort multiple record block

    Hi, i want to sort a multiple record block by pressing a key on a non updatable field in the block. Example: i have a list of adresses in the block. Now i want to jump to all Adresses which starts with B. Does anybody know a solution ? Thanks in adva

  • Importing GroupePartners with dtw : Type of BusinessPartnerGroups

    Hello, when i try importing BusinessPartnersGroups (code, name, type) I have to put a GroupType (S for Supplier or C for Customer) but it is not S or C but others value which are not into the SDK object browser. does anyone know these values ? thanks

  • Function module Documentation

    Hi, Can anybody send me following function module Documentation. LOAN_CHECK_POSTING_PRODUCTTYPE LOAN_CHECK_POSTING_VDARL LOAN_READ_VDARL BSS_CREATE_PAYSPLIT LOAN_REFERENCE_READ_OBJECTID LOAN_POST LOAN_IST_SCHREIBEN LOAN_REFERENCE_DELETE LOAN_REFERENC

  • Apple TV not showing up since update to Leopard

    We have three networked computers, mine being the one shared with the mac. Today, after my latest update (if that is relevant) I can not get it to show up in ITunes. And preferences for ITunes does not see the apple TV. It shows the shared itunes of