Remotely execute SSIS pkg with VBScript pass var

Anything VBScript-related, including Windows Script Host, WMI, ADSI, and more.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Locked
User avatar
ismailc
Posts: 37
Last visit: Tue Jun 09, 2015 12:16 am

Remotely execute SSIS pkg with VBScript pass var

Post by ismailc »

Good day, How can I remotely execute SSIS package passing variables defined in the package with VBScript. The SSIS package & my site are two different servers. So i need to remotely execute SSIS package on the SQL server together with passing variables Please provide some code. Regards

jvierra
Posts: 14890
Last visit: Mon Aug 02, 2021 5:28 am
Answers: 12
Has voted: 3 times
Been upvoted: 10 times

Remotely execute SSIS pkg with VBScript pass var

Post by jvierra »

http://msdn.microsoft.com/en-us/library/ms162810.aspx




Use the command line utilites for sqlserver. No need to write a script. SSIS is designed foe simplcity.


User avatar
ismailc
Posts: 37
Last visit: Tue Jun 09, 2015 12:16 am

Remotely execute SSIS pkg with VBScript pass var

Post by ismailc »

Hi, Help please, Winning but not there yet.

I managed to update the list with javascript (i know javascript)I have 2 issues not being the javascript.

1. I only seem to update the list when filtering on ID, I don't have the id & only know the Title in my 3rd party app. I tried removing ID & filter on Title but no luck

2. Some authentication issue, it asks me to login on all my internal web apps everytime.

Code: Select all

function SaveListItem()
{
    var soapRequest = '<?xml version="1.0" encoding="utf-8"?>' +
    '<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">' +
    ' <soap12:Body>'+
    ' <UpdateListItems xmlns="<a href="" target="_blank">'">http://schemas.microsoft.com/sharepoint/soap/">'</A>+
    ' <listName>Vendor Request</listName>'+
    ' <updates>'+
    '<Batch OnError="Continue">'+
    ' <Method ID="1" Cmd="Update">'+
    ' <Field Name="ID">772</Field>'+
    ' <Field Name="FSObjType">1</Field>'+
    ' <Field Name="BaseName">70002</Field>'+
    ' <Field Name="Title">70002</Field>'+
    ' <Field Name="Vendor0">TestData9</Field>'+
    ' </Method>'+
    '</Batch>'+
    ' </updates>'+
    ' </UpdateListItems>'+
    ' </soap12:Body>'+
    '</soap12:Envelope>';
    xmlHttp=new XMLHttpRequest();
    xmlHttp.open('post', 'http://srv08-za143/workspace/departments/masterfiles/_vti_bin/Lists.asmx', true);
    xmlHttp.setRequestHeader('Content-Type','application/soap+xml; charset=utf-8');
    xmlHttp.send(soapRequest);
}

Please Assist! - nearly there

ismailc2010-01-10 11:09:54

jvierra
Posts: 14890
Last visit: Mon Aug 02, 2021 5:28 am
Answers: 12
Has voted: 3 times
Been upvoted: 10 times

Remotely execute SSIS pkg with VBScript pass var

Post by jvierra »

Set the xmlHTTP to use credentials.

jvierra
Posts: 14890
Last visit: Mon Aug 02, 2021 5:28 am
Answers: 12
Has voted: 3 times
Been upvoted: 10 times

Remotely execute SSIS pkg with VBScript pass var

Post by jvierra »

Code: Select all

 
function SaveListItem( service, xmlSoapRequest){
    var xmlhttp = new ActiveXObject ("Microsoft.XMLHTTP"); 
    xmlhttp.
    xmlhttp.Open("POST", service, false,null,null); // or user password
    // should use try/catch here
    xmlhttp.Send(xmlSoapRequest); 
    return xmlhttp.responseXML;    
}
var soapRequest =  
    "<?xml version='1.0' encoding='utf-8'?>"
    + "<soap12:Envelope xmlns:xsi=]http://www.w3.org/2001/XMLSchema-instance] xmlns:xsd=]http://www.w3.org/2001/XMLSchema] xmlns:soap12=]']>http://www.w3.org/2003/05/soap-envelope]>"
    + "     <soap12:Body>"
    + "         <UpdateListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'>"
    + "             <listName>Vendor Request</listName>"
    + "             <updates>"
    + "                 <Batch OnError='Continue'>"
    + "                     <Method ID='1' Cmd='Update'>"
    + "                         <Field Name='ID'>772</Field>"
    + "                         <Field Name='FSObjType'>1</Field>"
    + "                         <Field Name='BaseName'>70002</Field>"
    + "                         <Field Name='Title'>70002</Field>"
    + "                         <Field Name='Vendor0'>TestData9</Field>"
    + "                     </Method>"
    + "                 </Batch>"
    + "             </updates>"
    + "         </UpdateListItems>"
    + "     </soap12:Body>"
    + "</soap12:Envelope>";
WScript.Echo( soapRequest);
SaveListItem( "http://srv08-za143/workspace/departments/masterfiles/_vti_bin/Lists.asmx",soapRequest);

Remember that command line jscript is not esxactly the same a JavaScript in a browser and it is not at all like Java.


jvierra2010-01-10 16:59:42

Locked