Thanks for the help with moving jobs from one server to another.
Now that I have moved them, they now fail each and all. I have copied the script and saved them as vbs files and placed them in a folder on the server and ran them successfully. I think it has something to do with the rights, but I don't know what. Could someone shed some light on possible causes?
Thanks,
LeeCould you post the errormessage?|||When I go to history, this is what is shown in the bottom
The job failed. The Job was invoked by Schedule 16 (NewMeterSch). The last step to run was step 1 (CreateMeterWO).|||Open the Job History, click on 'Show step details'.
For sted id, you should have a 0 and 1, highlight step id 1 which the job step is run agent.
Post that message?
Lystra|||Thanks for the help with moving jobs from one server to another.
I have copied the script and saved them as vbs files and placed them in a folder on the server and ran them successfully. Thanks,
Lee
Lee ... are these DTS packages that you scripted out and recreated on another server? If so, you will have to edit them to create the proper connection to the new server, because the existing conection will point to the old server.|||No, these jobs are not running DTS, They are vbscript. However it does use a dsn connection to the data. I have changed the script to call the correct dsn. Just to see if I had any errors, I copied the data into notepad and saved it as a vbs app; placed it in a folder on the server and ran the vbs. it ran fine. It just does not from within Jobs.
set Recordset1 = CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = "dsn=SmithData;uid=donkey;pwd=mule;"
Recordset1.Source ="SELECT otbl_o_d_ProductionInfo.LineNum, otbl_o_d_ProductionInfo.Dept, otbl_o_d_ProductionInfo.EquipType, Sum(otbl_o_d_ProductionInfo.Production) AS SumOfProduction, tbl_cmms_Mertering.PMType FROM otbl_o_d_ProductionInfo INNER JOIN tbl_cmms_Mertering ON otbl_o_d_ProductionInfo.EquipType = tbl_cmms_Mertering.EquipType AND otbl_o_d_ProductionInfo.EntryDate >= tbl_cmms_Mertering.DateOfChange AND otbl_o_d_ProductionInfo.LineNum= tbl_cmms_Mertering.LineNum AND otbl_o_d_ProductionInfo.EquipType=tbl_cmms_Merteri ng.EquipType WHERE tbl_cmms_Mertering.UD2=0 GROUP BY otbl_o_d_ProductionInfo.LineNum, otbl_o_d_ProductionInfo.Dept, otbl_o_d_ProductionInfo.EquipType, tbl_cmms_Mertering.PMType HAVING Sum(otbl_o_d_ProductionInfo.Production)>=Max(tbl_cmms_Mertering.lifecycle)*.98"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 3
Recordset1.Open()
Recordset1_numRows = 0|||Apparently my username does not have the rights to run ActiveX jobs. I found this out by having our admin who has the password to sa change the owner to sa and the jobs ran. My question is how/can I be given rights to run ActiveX without signing on as sa (our admin is not going to let that happen)? Or better yet, can someone help me understand how script the job in SQL.
What I am doing is looping through the results of the query that is wrapped in the vbscript and writing a record into another table (again the loop and insert statement is wrapped in vbscript).
While I can script loops fairly well in vbscipt, I am not experienced in SQL.
Thanks,
Lee
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment