Alternatives to Running Scheduling DTS Packages with SQLSERVERAGENT

We need some help figuring out how to run scheduled jobs (dts packages) without using the SQLSERVERAGENT as the user who runs the package.  We cannot use the agent because of security reasons beyond our control.  There has to be other simple ways to run this package.  

The DTS Package looks like this
Truncate --> OLE DB Provider for Oracle --> QA --> Load Table.

Hopefully that makes sense to someone because I'm a new to the database world.  
Who is Participating?
to have your packages automated , you will need some sort of scheduler program. If you can not use sqlserver agent then either you can use the Windows System scheduler, or get one from the internet( free or pay )

the way you can run a DTS package through a DOS Command is using the command line utility DTSRUN

DTSRUN /S ServerName /N PackageName

Save the above in a  batch file (.bat) and have your chosen scheduler to run the above command.

Also, I have been in the sql server business for 5+ years now and have never encountered any security problems with sqlserver agent. If you can, please share your reasons why you dont what to use sqlserver agent. In my option it is a really good scheduling mechanism...
We are using a product called Visual Cron to run SQL Jobs.  You can also run DTS Packages, SSIS Packages, Stored Procedures, and Queries.  It works much better then Windows Task Scheduler.  You can specify an account that you want to run each step of your visual cron job.
Mark WillsTopic AdvisorCommented:
Can even run OSQL (or DTSRUN) jobs via a batch program which can be scheduled by Windows Scheduler. Also works for BCP if bulk loading data...

Is the problem with DTS - because you can write T-SQL code for anything DTS can do, or is it Scheduling out side of SQL Server ? Plenty of possibilities, but might need a bit more direction...

Visual Cron sounds promising as well - would be very handy to nominate a "secured" user account to run some of these types of things (is this the start of Unix invading MS ?)

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

etan08Author Commented:
Thanks for your suggestions so far, sorry for not being as active in this post as I should be...

Wiz, we cannot use the sqlserver agent because there was an issue previously and they will not allow us to use the agent with more permissions then it has now.  I'm not sure of the complete reason, that's just the gist.

Thor, if we can't get the dtsrun.exe to execute the scheduled task I will bring this up and see what they think about it, looks like a valid solution though. However, I think that the dtsrun will perform like we need it to. (I'll test it tomorrow)

Mark, it is a problem getting the DTS package to run under something other than sqlserver agent, I am interested in how to write T-SQL code for what the package executes (assuming the T-SQL code doesn't run the job in sqlserver agent).  Any learning resources I should look into for this specific purpose?
I have not done this before but this might help.  This is from help in sql.

[/?] |
        /[~]S server_name[\instance_name]
        { {/[~]U user_name [/[~]P password]} | /E }
        {/[~]N package_name }
        | {/[~]G package_guid_string}
        | {/[~]V package_version_guid_string}
    [/[~]M package_password]
    [/[~]F filename]
    [/[~]R repository_database_name]
    [/A global_variable_name:typeid=value]
    [/L log_file_name]
    [/W NT_event_log_completion_status]
    [/Z] [/!X] [/!D] [/!Y] [/!C]

You should be able to use something like this.

dtsrun /U user_name /P password /N package_name /G package_guid_string /V package_version_guid_string /W True

Theses values can be found in the msdb database in table sysdtspackages
package_name - Is the name of a DTS package assigned when the package was created.

package_guid_string - Is the package ID assigned to the DTS package when it was created. The package ID is a GUID.

package_version_guid_string - Is the version ID assigned to the DTS package when it was first saved or executed. A new version ID is assigned to the DTS package each time it is modified. The version ID is a GUID.

Please be sure to look at the package version.  Everytime you save a package it creates a new version record in the table.  According the the statement above you will want the first one created.

Again you can look in help to see some examples and help information.  You can also type from a cmd prompt: dtsrun /?.
If you want to do it from OSQL you can also look in help for that command.  Since you already have the DTS package created dtsrun makes more sense.
Mark WillsTopic AdvisorCommented:
There are several windows executable programs which can be launched fro the DOS prompt (using old fashioned term).

OSQL or DTSRUN (or BCP - and more) jobs can there be launched via a batch program which can be scheduled by Windows Scheduler. Also works for BCP if bulk loading data... They are considered part of the "engine" and so are available throughout every SQL server edition (except compact 3.5). In 2005 we also get sqlcmd which is meant to replace osql.

As a simple example for OSQL, which could also be DTSRUN as ThorSG1 shows above...

In windows, create a batch job (or cmd) : simple one liner, but would expect comments, versioning etc in "real life" e.g (between the rem's)
rem batch test to runs an osql script from dos
"c:\Program Files\Microsoft SQL Server\80\Tools\Binn\osql.exe" /E /e /n /ic:\mysql\jobs\UPDATE_RATE_CARD_END_DATE.sql /oc:\mysql\logs\UPDATE_RATE_CARD_END_DATE.log
rem that is as easy as it can be
then simply create another text file, saving it with the extension sql (by way of convention) which has your T-SQL code...e.g. (between the -- )
--sql script to update the "end date" to be the end of day ie be a datetime finishing at 23:59:59
IF (DB_NAME() <> 'MYDB')
  RAISERROR('Could not attach to MYDB database, aborting...',10,127)
select 'Started On : ',getdate()
update tbl_rate_card set end_time = dateadd(ss,-1,dateadd(dd,1,convert(datetime,convert(varchar(20),rca_end_time,106))))
select 'Ended On : ',getdate()
-- that is all for now...
then all that has to happen is to run it - just like any other batch job. Or go to windows scheduler, new task, browse for the batch job, and schedule.

Open in new window

Mark WillsTopic AdvisorCommented:
also the folder name in the example above has nothing to do with mysql it is more "my own sql stuff" , and the results of the run including the outputs of the select statements are visible in the log file - ie using the /o option.

For specific syntax, would need to look up Books on line - there is quite a few bits and options...
etan08Author Commented:
We had a problem coming up with the correct syntax that the dtsrun.bat should have.  To solve this issue we used dtsrunui.exe and that automated the process under advanced and automate.  I hope this helps anyone who is considering this option.  Thanks for the help everyone works like a charm.

etan08Author Commented:
Thanks for the help!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.