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

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

  • SQL Server job failed. The Job was invoked by Schedule 11 (NAV Backup 1). The last step to run was step 1 (Subplan_1)

    Date 07-01-2014 10:00:00 PM
    Log Job History (NAV Backup 1.Subplan_1)
    Step ID 1
    Server NAVSRV
    Job Name NAV Backup 1.Subplan_1
    Step Name Subplan_1
    Duration 00:02:26
    Sql Severity 0
    Sql Message ID 0
    Operator Emailed
    Operator Net sent
    Operator Paged
    Retries Attempted 0
    1122

    About your question on How and Who changed it, i told that nobody changed it. I found in this way.
    1122
    I also Saw the plan and the path of Database and database log was ok , i mean PHARMANEXT_LOG_95ABA2F6-DC67-4CFC etc...
    was exactly like in the C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA
    Maybe is something wrong with my backup script, but i dont think so because before 23 of december
    everithing was ok. After this date it failed.
    Anyway check this script of "Remove SQL log" , the one that you think is a culprit:
    DECLARE @name VARCHAR(50)
    DECLARE @fileName VARCHAR(256)
    DECLARE db_cursor CURSOR FOR 
    SELECT name 
    FROM master.dbo.sysdatabases 
    WHERE name NOT IN ('master','model','msdb','tempdb') 
    OPEN db_cursor  
    FETCH NEXT FROM db_cursor INTO @name  
    WHILE @@FETCH_STATUS = 0  
    BEGIN  
    SET @filename = @name + '_log' 
    Exec ('Use [master] alter database [' + @name + '] set recovery simple')
    Exec ('Use [master] alter database [' + @name + '] set recovery FULL')
            Exec ('Use [' + @name + '] DBCC SHRINKFILE ("' + @filename + '",1)')
           FETCH NEXT FROM db_cursor INTO @name  
    END  
    CLOSE db_cursor  
    DEALLOCATE db_cursor
    go
    Hello,
    You have created a cursor which will take all user databases and change recovery model to Simple and then to full what this will cause it will break the log chain and you might loose your RPO and RTO.This operation truncates the log .Please stop this job
    immediately.It is worst you can do to your Database recovery and availability.After this you are trying to shrink .
    As pointed out it is seriously not advised to shrink data file.And if you have proper trn log backup it manages the growth of log file
    Hope this helps
    Keep looking for any such activity which might change anything in your database
    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers

  • 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 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

  • Capture duration time and use it in customized the SQL Server Job System Message

    Hi there
    I am trying to capture the job duration time and put it on the customized Job email subject.
    This is the original message from SQL server, the Bold one is what I am trying to capture.
    JOB RUN:            
    'Hello' was run on 7/30/2014 at 8:05:00 AM
    DURATION:       
    0 hours, 0 minutes, 2 seconds
    STATUS:              
    Succeeded
    MESSAGES:        The job succeeded. 
    The Job was invoked by Schedule 27 (Job 2).  The last step to run was step 1 (Test).
    Is there anyway to do that? I have tried to pull it from jobhistory and I did't have any luck.
    Cheers,
    Matt

    You can take this code and send it to a table, then create your reports
    ; WITH CTE as -- Use a Simple Common Table Expression
    SELECT ROW_NUMBER() OVER (PARTITION BY job_name -- Add the comma separate columns that need to be unique in the table
    ORDER BY ( SELECT 0 ) ) RN ,* -- If the order does not matter on the one you want to keep - the select 0 work well; otherwise add the appropriate order by to make the row you want to keep appear at the top
    FROM (
    select TOP 100000 job_name, run_datetime, run_duration,run_status
    from
    select job_name, run_datetime,run_status,
    SUBSTRING(run_duration, 1, 2) + ':' + SUBSTRING(run_duration, 3, 2) + ':' +
    SUBSTRING(run_duration, 5, 2) AS run_duration
    from
    select DISTINCT
    j.name as job_name,
    run_datetime = CONVERT(DATETIME, RTRIM(run_date)) +
    (run_time * 9 + run_time % 10000 * 6 + run_time % 100 * 10) / 216e4,
    run_duration = RIGHT('000000' + CONVERT(varchar(6), run_duration), 6)
    ,h.run_status
    from msdb..sysjobhistory (NOLOCK)h
    inner join msdb..sysjobs (NOLOCK)j
    on h.job_id = j.job_id
    where h.step_id = 0
    ) t
    ) t
    order by job_name, run_datetime desc
    )X
    SELECT @@servername as [ServerName],RN,job_name,run_datetime,run_duration,run_status
    FROM CTE
    ORDER BY run_duration desc
    Javier Villegas |
    @javier_vill | http://sql-javier-villegas.blogspot.com/
    Please click "Propose As Answer" if a post solves your problem or "Vote As Helpful" if a post has been useful to you

  • 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

Maybe you are looking for

  • Data on my HP Officejet Pro 8500 A909a display is unreadable

    I was having a problem after I replaced my black ink cartridge. My HP 8500 A909a wasn't displaying the ink level for the new black cartridge I installed. I tried to perform a partial reset to restore the HP All-in-One to proper operation as stated in

  • Use of Dimensions in Multiprovider?

    Hi Experts, Can any one let me know while creating Multiprovider,why we should again select the infoobjects(from sub cubes) in to Dimensions(in MP)?Is it necessary?what are the Pros and Cons of this concept? Thanks James

  • Get Conditions for Service sub positions

    Hello , i use a purchase order form this FM RV_PRICE_PRINT_ITEM to get conditions of position but in case of service position which have sub-position with they own conditions i can't find how get that conditions y search the tables konp,konh, KONV bu

  • Bank Key giving error for ECC to CRM replication

    While replicating BPs from ECC to CRM, the following error shows in the BDoc: "Bank XXXX-YYY for Country ZZ does not exist" To the best of our understanding, the Bank (branch: XXXX-YYY) detail is not available in the CRM, but where to make in CRM or

  • My lad has changed my password and now i carnt get on my i pod

    My lad has changed my password & now im locked out as he carnt remember it