OnRun() IF ISCLEAR(ADOConnection) THEN; CREATE(ADOConnection); ADOConnection.ConnectionString := GetConnectionString; ADOConnection.Open; IF ISCLEAR(ADOCommand) THEN CREATE(ADOCommand); lvarActiveConnection := ADOConnection; ADOCommand.ActiveConnection := lvarActiveConnection; ADOCommand.CommandText := 'sp_start_job'; ADOCommand.CommandType := 4; ADOCommand.CommandTimeout := 0; ADOParameter := ADOCommand.CreateParameter('@job_name', 200, 1, 50, GLSetup."Index Job Name"); ADOCommand.Parameters.Append(ADOParameter); ADOCommand.Execute; ADOConnection.Close; GetConnectionString() : Text[1024] GLSetup.GET; GLSetup.TESTFIELD("Server Name"); GLSetup.TESTFIELD("Index Job Name"); ConnectString := 'Driver={SQL Native Client};' + 'Server=' + GLSetup."Server Name" + ';' + 'Database=msdb;Trusted_Connection=yes;'; EXIT(ConnectString);
Comments
1) WebService (I hope that it is possible to call WS from SQL procedure, definitely yes, if you create the procedure in Visual Studio...)
2) Some flag in some table (NAS will periodically check the flag, SQL will set the flag)
3) MSMQ
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
The site is 5.0 SP1 so option 1 is currently not an option. Options 2 and 3 are both possibilities. Another option I'm thinking about is using a Job Queue (a variatio of NAS) task that fires off and watches a table for a specific record, then continues on once it finds that record. This would be similar to your option 2. This process only needs to run once a week (on the weekend) and it does not need to be immediately after the SQL process. If there was a short delay it would be fine. The issue is more not having someone needing to hang around till the SQL process completes, so they can start the NAV process.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.