June 18, 2007 at 1:49 pm
I created a SQL Server job but the user said the job did not have a fixed schedule. Each month depending when he received the data, then execute the job. That means each month he would call me to execute the job. So I want to use osql command to create a bat file. So when it is ready, the user can start the job himself.
However I had two problems. First the osql command requires SQL Server user id and password and I did not want to put in the bat file because it is not secure. Second I am not even sure osql is the correct command to start the sql server job.
Can anyone give me any suggestion?
Thanks
June 18, 2007 at 2:04 pm
Job make a sp that starts the job (sp_start_job?!). Make a vbs file that uses windows authentication (so no login info is visible).
I never had to do this but I'm sure it can be made to work that way.
June 18, 2007 at 2:48 pm
I like Ninja's example, but you don't need to use vbs if you're not experienced with it.
You can use windows authentication and the -E switch on osql for integrated security. Grant the user execute rights on the procedure. Piece of cake.
June 18, 2007 at 2:53 pm
I go with what I know... I never used osql.
Thanks for the tip .
June 19, 2007 at 10:56 am
I created a SQL table which I allow specific users to insert to. Each user has a spreadsheet with a control button which inserts a request into the SQL table. I have a scheduled job in SQL which executes a stored procedure which checks for new requests each minute (during certain hours) and processes the requests by executing the DTS desired (the requests have a status flag [new, in process, and done] and I only process the TOP 1 [the oldest new status] each cycle.
~Michael T
June 20, 2007 at 4:13 am
First the osql command requires SQL Server user id and password and I did not want to put in the bat file because it is not secure
You have the option to specify your windows authentication switch too. /E switch can be used instead of giving a user id and password.
Cheers,
Sugeshkumar Rajendran
SQL Server MVP
http://sugeshkr.blogspot.com
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply