1

Topic: Start of a script from the trigger

Good afternoon
Faced necessity to launch on the trigger on the table a script on the second server.
Idea noble -   when the new data, here only basis MS SQL and the necessary web server-Nginx PHP comes.
One of decisions...

BEGIN
exec master. xp_cmdshell ' c:\progra~1\intern~1\iexplore.exe http://www.somesite.com/compile.php'
END

But here that it me confuses that strongly, it would be desirable what that more reasonable alternative, for example, not to use iexplore, considering that both   in one network.
Share decisions if those are.

2

Re: Start of a script from the trigger

Extremist;
And why it is necessary from under whining to launch?
Can make  - the table, for example, DocJob.
And there to throw the data - "the new data Came"
And in "Task scheduler" to launch jobs each 5 mines... Is a job checks DocJob the table.
In this case the task is segmented - each of which can be fulfilled independently.

3

Re: Start of a script from the trigger

Massa52;
On specificity it would be necessary that as soon as possible after dock data acquisition is collected.
Certainly it is far not the fact that there and then read it, but, under the meanness law, the assembly happened, the data came, the client read become outdated to dock, in minutes . The Total - cries that having the data we did not give them in time.
Basically now it and works, only  the collector of crones

4

Re: Start of a script from the trigger

Extremist wrote:

Massa52;
On specificity it would be necessary that as soon as possible after dock data acquisition is collected.
Certainly it is far not the fact that there and then read it, but, under the meanness law, the assembly happened, the data came, the client read become outdated to dock, in minutes . The Total - cries that having the data we did not give them in time.
Basically now it and works, only  the collector of crones

Well, if so it is important - make on PHP check (whether it is necessary ?) before document output.
Well and further on : or  on the fly, or you broadcast "wait..."

5

Re: Start of a script from the trigger

Extremist wrote:

Good afternoon
Faced necessity to launch on the trigger on the table a script on the second server.
Idea noble -   when the new data, here only basis MS SQL and the necessary web server-Nginx PHP comes.
One of decisions...

BEGIN
exec master. xp_cmdshell ' c:\progra~1\intern~1\iexplore.exe http://www.somesite.com/compile.php'
END

But here that it me confuses that strongly, it would be desirable what that more reasonable alternative, for example, not to use iexplore, considering that both   in one network.
Share decisions if those are.

Start of everyone exterior  from the trigger is outside of good and harm:-D
But, for example:
Make SQLCLR function which will send request httprequest with it  and cause it
Type such

using System;
using System. Collections. Generic;
using System. Linq;
using System. Text;
using System. Threading. Tasks;
using System. Net. Http;
using System. Net. Http. Headers;
namespace HttpClientAPP
{
class Program
{
static void Main (string [] args)
{
HttpClient client = new HttpClient ();
client. BaseAddress = new Uri ("http://www.somesite.com/compile.php");
//Add an Accept header for JSON format.
client. DefaultRequestHeaders. Accept. Add (new MediaTypeWithQualityHeaderValue ("application/json"));
//List all Names.
HttpResponseMessage response = client. GetAsync ("api/Values").Result;//Blocking call!
if (response. IsSuccessStatusCode)
{
var products = response. Content. ReadAsStringAsync ().Result;
}
else
{
Console. WriteLine ("{0} ({1})", (int) response. StatusCode, response. ReasonPhrase);
}
}
}
}

6

Re: Start of a script from the trigger

Extremist;
Or so
https://msdn.microsoft.com/en-us/library/ms973816.aspx

7

Re: Start of a script from the trigger

Thank you very much.