Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

Read from XML file, match text with system variable and output value to user variable

$
0
0

I am new with SSIS and struggling with Script task. Trying to figure out how to build script for following scenario.

Here is scenario

I have XML file has following data

  • <?xml version="1.0" encoding="utf-8"?>
    <environments>
      <environment>
        <name>DEV3WEB</name>
        <databaseservername>DEV3DB.abc.com</databaseservername>
        <webservername>http://DEV3WEB.abc.com/</webservername>
        <appservername>DEV3APP.abc.com</appservername>
      </environment>
      <environment>
        <name>DEV3APP</name>
        <databaseservername>DEV3DB.abc.com</databaseservername>
        <webservername>http://DEV3WEB.abc.com/</webservername>
        <appservername>DEV3APP.abc.com</appservername>
      </environment>

</environments>

I want script task read 'Name' from XML file - match with System variable 'Machine Name' and write output to user variable 'ServerNumber'.

If machine name is DEV3WEB - output will be number '1' and DEV3APP output will be number '2'.

Thanks in advance.


Thanks -Mehta



Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>