Need to run sql server package after job(loading) done

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
prasson_ibm
Premium Member
Premium Member
Posts: 536
Joined: Thu Oct 11, 2007 1:48 am
Location: Bangalore

Need to run sql server package after job(loading) done

Post by prasson_ibm »

Hi,
I am connecting to SQL Server using ODBC connection and i have requirement where i need to call package after job completes.

Code: Select all

EXEC msdb.dbo.sp_start_job @job_name = 'app.GetVisionCasaDailyExtract';
My question is can i run this in Stored Proc stage if not then which stage should i use to trigger this.
stephan.zahariev
Premium Member
Premium Member
Posts: 9
Joined: Sun Feb 12, 2012 11:05 am
Contact:

Post by stephan.zahariev »

Hi,

You can create a sequence to invoke the job and afterwards use the "Execute Command" to run the stored procedure using the sqlcmd command.

Alternatively you can create after job subroutine to invoke the same stored procedure using the sqlcmd.

My personal preference goes to the first solution.
prasson_ibm
Premium Member
Premium Member
Posts: 536
Joined: Thu Oct 11, 2007 1:48 am
Location: Bangalore

Post by prasson_ibm »

Hi,
Can you please tell me the full syntex to connect to seqserver from unix command prompt using sqlcmd.
When i am running this command it got failed.

Code: Select all

dsadm@ait-etl01dev:/inboundetl/dev $ sqlcmd
ksh: sqlcmd:  not found.
prasson_ibm
Premium Member
Premium Member
Posts: 536
Joined: Thu Oct 11, 2007 1:48 am
Location: Bangalore

Post by prasson_ibm »

Hi,

Can not i call it in stored procedure stage.
stephan.zahariev
Premium Member
Premium Member
Posts: 9
Joined: Sun Feb 12, 2012 11:05 am
Contact:

Post by stephan.zahariev »

Sorry, did not noticed that you are running the job under Unix. The sqlcmd is a windows command.

Have no experience accessing the SQL Server from the Unix shell but this could work: http://www.sqsh.org/
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

prasson_ibm wrote:Can not i call it in stored procedure stage.
I would certainly think so, yes.
-craig

"You can never have too many knives" -- Logan Nine Fingers
prasson_ibm
Premium Member
Premium Member
Posts: 536
Joined: Thu Oct 11, 2007 1:48 am
Location: Bangalore

Post by prasson_ibm »

Hi Chullet,

Thanks I will test with stored proc stage and then post the result.
prasson_ibm
Premium Member
Premium Member
Posts: 536
Joined: Thu Oct 11, 2007 1:48 am
Location: Bangalore

Post by prasson_ibm »

Hi Chullet,
You are right its working in SP stage but i will also try to execute it in After SQL of the ODBC stage.
I am making this topic as resolved.
Post Reply