Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Job STep with multiple commands Expand / Collapse
Author
Message
Posted Wednesday, July 24, 2013 8:23 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: 2 days ago @ 2:05 AM
Points: 6, Visits: 55
Good day
I want to make a job step,but it must do various commands.The steps is as follows.
1.Copy a file over to another file location
2.Insert a records into a table in the database
3. Run a dtsx import script
4. Delete the original file which i have copied.

i can achieve all this,but now i have 4 steps in my job.Is it possible to make 1 step,because i have to repeat this procedure for over 380 files.It would be nice to streamline the whole process.

thanks for your help in advance.
Post #1477088
Posted Thursday, July 25, 2013 11:45 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Yesterday @ 6:25 AM
Points: 1,226, Visits: 2,548
Janda Nel (7/24/2013)
Good day
I want to make a job step,but it must do various commands.The steps is as follows.
1.Copy a file over to another file location
2.Insert a records into a table in the database
3. Run a dtsx import script
4. Delete the original file which i have copied.

i can achieve all this,but now i have 4 steps in my job.Is it possible to make 1 step,because i have to repeat this procedure for over 380 files.It would be nice to streamline the whole process.

thanks for your help in advance.


The CmdExec job step will only execute a single line - you can include multiple commands in a single line if you separate them with "&&" (don't use the quotation marks).

However, since you seem to have the ability to execute an SSIS package, it might be a lot easier to create a package with a For Each Loop container that would perform the same tasks on each file in a folder, then schedule a SQL Agent job to run the package.


Jason Wolfkill
Blog: SQLSouth
Twitter: @SQLSouth
Post #1477651
Posted Friday, July 26, 2013 6:35 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Friday, May 30, 2014 8:15 AM
Points: 1,056, Visits: 2,687
Janda Nel (7/24/2013)
Good day
I want to make a job step,but it must do various commands.The steps is as follows.
1.Copy a file over to another file location
2.Insert a records into a table in the database
3. Run a dtsx import script
4. Delete the original file which i have copied.

i can achieve all this,but now i have 4 steps in my job.Is it possible to make 1 step,because i have to repeat this procedure for over 380 files.It would be nice to streamline the whole process.

thanks for your help in advance.


create step 5 and create query to identify any pending and pass it to success with go to step 1 and failure to close the job.

i hope like the above user said using SSIS is easier.


Regards
Durai Nagarajan
Post #1477966
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse