Thursday, April 23, 2009

Schedule and Run a SSIS package

  • SQL Server 2005 is bit different from SQL Server 2000. In SQL Server 2000, you can create the job and run it without problem. In SQL Server 2005, we need to follow some steps for creating job.
  • The job creator account should have the roles of Sysadmin, SQLAgentuser, SQLAgentReader, SQLAgentOperator and job needs to be run under proxy account
  • The steps are follows as below.
  • Creating Account:
    SQL Server Management Studio- >Highlight Security->New Login->Give login user and password and database is your selected database
  • Server roles: check sysadmin
    User mapping: your database
    Msdb database:Iinclude SQLAgentUserRole, SQLAgentReaderRole, SQLAgentOperatorRole -> click on OK.
  • Creating Proxy Account:
  • In Object Explorer, expand a server.
  • Expand SQL Server Agent.
  • Right-click Proxies and select New Proxy.
  • On the General page of the New Proxy Account dialog, specify the proxy name, credential name, and description for the new proxy. Note that you must create a credential first before you create a proxy if one is not already available. For more information about creating a credentialCheck the appropriate subsystem for this proxy.
    On the Principals page, add or remove logins or roles to grant or remove access to the proxy account
  • Creating Credentials:
  • In Object Explorer, expand Security, right-click Credentials, and then click New Credential.
  • In the New Credentials dialog box, in the Credential Name box, type a name for the credential.
  • In the Identity box, type the name of the account used for outgoing connections (when leaving the context of SQL Server). Typically, this will be a Windows user account. But the identity can be an account of another type.
  • In the Password and Confirm password boxes, type the password of the account specified in the Identity box. If Identity is a Windows user account, this is the Windows password. The Password can be blank, if no password is required.
    Click OK.
  • Job Creation,Scheduling,Running:
  • In SQL Server Management Studio-> SQL Server Agent -> Start. Select job ->New Job>give name
  • Then select steps tab-> New Step->give name
  • Type: SQL Server Integration Service Package->Run asmyProxy->Package source: File System.
  • Select your file through browse->YourPackage.dtsx->Say OK->then schedule and run it

No comments: