<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Christoph's Blog</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/christophputz/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/christophputz/feed.xml</link>
    <description />
    <lastBuildDate>Tue, 16 Apr 2019 04:54:43 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Delete BizTalk Artifacts within C#</title>
      <link>https://docs.microsoft.com/archive/blogs/christophputz/delete-biztalk-artifacts-within-c</link>
      <pubDate>Tue, 01 Dec 2015 05:22:50 GMT</pubDate>
      <dc:creator><![CDATA[xoph1]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/christophputz/2015/12/01/delete-biztalk-artifacts-within-c/</guid>
      <description><![CDATA[When you are developing and testing BizTalk projects, one of the most common tasks is to cleanup...]]></description>
      <content:encoded><![CDATA[<p>When you are developing and testing BizTalk projects, one of the most common tasks is to cleanup BizTalk server from suspended items, running service instances and so on.</p>  <p>A commonly used method achieve this is to use the following powershell script:</p>  <p><font size="2" face="Courier New"><strong>Import-module “C:\Program Files (x86)\Microsoft BizTalk Server 2013 R2\SDK\Utilities\PowerShell\BizTalkFactory.PowerShell.Extensions.dll”</strong></font></p>  <p><font size="2" face="Courier New"><strong>Get-ChildItem –Path ‘BizTalk:\Health and Activity\Service Instances’ | % { $_.Terminate() }</strong></font></p>  <p>This method is very convenient compared to the standard method of deleting all the artifacts in the BizTalk Server Administration Console.</p>  <p>In automated test scenarios it is often necessary to reset the test environment to its initial state. You can use the following code to create a test step to achieve this. </p>  <blockquote>   <p><font size="2" face="Courier New"><strong>string scope = @&quot;root\MicrosoftBizTalkServer&quot;;          <br /></strong></font><font color="#008000" size="2" face="Courier New"><strong>/*          <br /></strong></font><font color="#008000" size="2" face="Courier New"><strong>&#160; ServiceClass possible values:          <br /></strong></font><font color="#008000" size="2" face="Courier New"><strong>&#160;&#160;&#160; Orchestration 1          <br /></strong></font><font color="#008000" size="2" face="Courier New"><strong>&#160;&#160;&#160; Tracking 2          <br /></strong></font><font color="#008000" size="2" face="Courier New"><strong>&#160;&#160;&#160; Messaging 4          <br /></strong></font><font color="#008000" size="2" face="Courier New"><strong>&#160;&#160;&#160; MSMQT 8          <br /></strong></font><font color="#008000" size="2" face="Courier New"><strong>&#160;&#160;&#160; Other 16          <br /></strong></font><font color="#008000" size="2" face="Courier New"><strong>&#160;&#160;&#160; Isolated adapter 32          <br /></strong></font><font color="#008000" size="2" face="Courier New"><strong>&#160;&#160;&#160; Routing failure report 64          <br /></strong></font><strong><font color="#008000" size="2" face="Courier New">*/          <br /></font><font size="2" face="Courier New">SelectQuery query = new SelectQuery(&quot;SELECT * FROM MSBTS_ServiceInstance Where ServiceClass = 1 or ServiceClass = 4 or ServiceClass = 64&quot;);</font></strong> </p>    <p><font size="2" face="Courier New"><strong>ManagementScope mScope = new ManagementScope(scope);</strong></font> </p>    <p><font size="2" face="Courier New"><strong>ManagementObjectSearcher searcher = new ManagementObjectSearcher(mScope, query);</strong></font> </p>    <p><font size="2" face="Courier New"><strong>ManagementObjectCollection btsArtifacts = searcher.Get();</strong></font> </p>    <p><strong><font size="2" face="Courier New">foreach (ManagementObject mobj in btsArtifacts)          <br /></font><font size="2" face="Courier New">{</font></strong><font size="2" face="Courier New">        <br /></font><font size="2" face="Courier New"><strong>&#160; mobj.InvokeMethod(&quot;Terminate&quot;, null);</strong></font><font size="2" face="Courier New">        <br /></font><font size="2" face="Courier New"><strong>}</strong></font></p> </blockquote>  <p>Another very useful code snippet is the following. It bounces all BizTalk host instances on the local machine. We use this in our automated tests scenarios where it is necessary to restart all instances after a configuration change.</p>  <blockquote>   <p><font size="2" face="Courier New"><strong><font color="#008000">string scope = @&quot;root\MicrosoftBizTalkServer&quot;;           <br /><font style="background-color: #9bbb59"></font></font></strong></font><font style="style" size="2" face="Courier New"><strong><font style="style" color="#008000">/*           <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ServiceState = 4 (= running)            <br />*/</font></strong></font><font size="2" face="Courier New"><strong><font style="background-color: #9bbb59"></font></strong></font></p>    <p><font size="2" face="Courier New"><strong>var query = new SelectQuery(&quot;SELECT * FROM MSBTS_HostInstance WHERE ServiceState = 4&quot;);         <br />ManagementScope mScope = new ManagementScope(scope);          <br />ManagementObjectSearcher searcher = new ManagementObjectSearcher(mScope, query);          <br />ManagementObjectCollection btsArtifacts = searcher.Get();          <br />foreach (var mobj in btsArtifacts.Cast&lt;ManagementObject&gt;())          <br />{          <br />&#160;&#160; mobj.InvokeMethod(&quot;Stop&quot;, null);          <br />&#160;&#160; mobj.InvokeMethod(&quot;Start&quot;, null);          <br />}</strong></font></p></blockquote>]]></content:encoded>
    </item>
    <item>
      <title>BizTalk Server Architecture – Cluster and BizTalk Groups on the same servers</title>
      <link>https://docs.microsoft.com/archive/blogs/christophputz/biztalk-server-architecture-cluster-and-biztalk-groups-on-the-same-servers</link>
      <pubDate>Fri, 26 Jun 2015 01:33:00 GMT</pubDate>
      <dc:creator><![CDATA[xoph1]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/christophputz/2015/06/26/biztalk-server-architecture-cluster-and-biztalk-groups-on-the-same-servers/</guid>
      <description><![CDATA[I am&#160; currently working on a BizTalk project for a big customer in the healthcare area. When I...]]></description>
      <content:encoded><![CDATA[<p>I am&#160; currently working on a BizTalk project for a big customer in the healthcare area. When I joined the team, the BizTalk environments, up to the production system, where already up and running. It was a relative simple architecture with 2 BizTalk Nodes working in a group and a SQL Failover Cluster serving as the database engine. After we started to elaborate the requirements of the targeted solutions, it turned out that we will need some components which require special attention when you design your BizTalk architecture. I am sure everybody who knows BizTalk, will also know the components I am talking about: FTP Receive Adapter and MSMQ Receive Adapter. This adapter are not allowed to run on more than one server at a time. So we had to communicate this to the customer and he became very unhappy when be began to talk about an additional BizTalk cluster to host this services. It was not acceptable for him to order more servers and BizTalk licenses, so we began to elaborate and cost saving architecture which can server all of our needs. In this post I want to present the resulting architecture.</p>  <p>As you can see in the picture below, we decided to use a combination of clustering and BizTalk Groups to get the most flexible architecture possible with only two BizTalk nodes. Basically, the two nodes are in a Windows Server Cluster. Only those BizTalk hosts which runs FTP, MSMQ, MLLP or ordered delivery file adapters run within a cluster. All other hosts use the standard BizTalk Server load balancing mechanism to maximize throughput. </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/62/metablogapi/3302.image_11E199D1.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-62-metablogapi/3302.image_5F00_11E199D1.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; float: none; padding-top: 0px; padding-left: 0px; margin-left: auto; display: block; padding-right: 0px; border-top-width: 0px; margin-right: auto" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/62/metablogapi/5734.image_thumb_04A03220.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-62-metablogapi/5734.image_5F00_thumb_5F00_04A03220.png" width="456" height="638" /></a></p>  <p>To be able to distribute the workload as flexible as possible, we planned a cluster group for each type of adapter (FTP, MSMQ, MLLP, ordered delivery file). This allows us to distribute the incoming workload on both BizTalk server nodes. Each cluster group must also hosts MSDTC so that a failure in MSDTC will also cause a failover of the corresponding BizTalk resource. MSDTC must also run locally on each server, so that all BizTalk hosts not running within a cluster group can use this local running version.</p>  <p>Please be aware that it is not possible to use Windows Network Load Balancing, when the BizTalk Servers are clustered. If you have a scenario where the BizTalk hosts services which should be accessed from outside (web services, http endpoints), you have to use an external load balancer. Windows load balancing is not supported when the servers are in a Windows cluster. </p>  <p>The BizTalk databases are hosted on a SQL Server cluster. We also use this cluster to host Enterprise Single Sign-On and MSDTC. There are multiple cluster groups in this cluster. One is dedicated to the BizTalk databases. MSDTC and SSO runs in one cluster group. </p>]]></content:encoded>
    </item>
    <item>
      <title>ETL Checklist</title>
      <link>https://docs.microsoft.com/archive/blogs/christophputz/etl-checklist</link>
      <pubDate>Thu, 22 Dec 2011 01:10:15 GMT</pubDate>
      <dc:creator><![CDATA[Christoph Putz]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/christophputz/2011/12/22/etl-checklist/</guid>
      <description><![CDATA[The content of this article is based on the experience I gained in a big data warehouse project. My...]]></description>
      <content:encoded><![CDATA[<p><strong><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">The content of this article is based on the experience I gained in a big data warehouse project. My initial intent writing this article is to provide a good starting point for other DWH projects where one have to design and build ETL processes. </span></span></strong></p>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">In the first chapter I am writing about the data sources and data source formats. My experience was, that it is a very important part to define the sources carefully, precisely and completely.</span></span></p>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">After the examination of the structure of the source data, I will have a look at the data content and the possible parts which are important for ETL processes.</span></span></p>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">The third chapter is an accumulation of functional requirements one may face when designing ETL processes.</span></span></p>
<p><span style="font-family: Calibri; font-size: small;" face="Calibri" size="3">&nbsp;</span></p>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">Don&rsquo;t consider this document as a comprehensive guide for designing ETL processes. My intent is to maintain this document by extending and adding content.</span></span></p>
<h2><span style="font-size: medium;" size="4"><span style="color: #4f81bd;" color="#4f81bd"><span style="font-family: Arial Black;" face="Arial Black">Source data</span></span></span></h2>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">The nature of a Data Warehouse project is that data is collected from various sources and also in various formats. So one of the most essential things is to define strict contracts for the interfaces thru which the data is collected.</span></span></p>
<ul>
<li><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">Here are some questions which should be answered by the contract</span></span></li>
<li><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">Where does the data come from?</span></span></li>
<li><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">Which data formats are used?</span></span></li>
<li><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">How is the data formatted?</span></span></li>
<li><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">Which Information is necessary to handle the data correctly?</span></span></li>
<li><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">How are different data types formatted? (number, date, time, ...)</span></span></li>
<li><span style="font-family: Calibri;" face="Calibri"><span style="font-size: small;" size="3">Content</span></span></li>
<ul>
<li><span style="font-family: Calibri;" face="Calibri"><span style="font-size: small;" size="3"></span></span><span style="font-family: Calibri;" face="Calibri"><span style="font-size: small;" size="3">Is there one record in the source for one Business Case? (for example one record for one customer)</span></span></li>
</ul>
<ul>
<li><span style="font-family: Calibri;" face="Calibri"><span style="font-size: small;" size="3">How are deleted records marked?</span></span></li>
</ul>
<ul>
<li><span style="font-family: Calibri;" face="Calibri"><span style="font-size: small;" size="3">Is it a complete set of data? (e.g. all customers or just a set of changes)</span></span></li>
</ul>
<ul>
<li><span style="font-family: Calibri;" face="Calibri"><span style="font-size: small;" size="3">Are trailing whitespaces part of the data?</span></span></li>
</ul>
</ul>
<h3><span style="color: #4f81bd;" color="#4f81bd"><span style="font-family: Cambria;" face="Cambria"><span style="font-size: small;" size="3">Structure</span></span></span></h3>
<ul>
<li><span style="font-family: Calibri;" face="Calibri"><span style="font-size: small;" size="3">Data source </span></span></li>
<ul>
<li><span style="font-family: Calibri;" face="Calibri"><span style="font-size: small;" size="3"></span></span><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">E.g. data files in directory or on a share, database tables or views, web services, &hellip;</span></span></li>
</ul>
<li><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri"></span></span><span style="font-family: Calibri;" face="Calibri"><span style="font-size: small;" size="3">Data format</span></span></li>
<li><span style="font-family: Calibri;" face="Calibri"><span style="font-size: small;" size="3"></span></span><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">Comma separated file, EBCDIC encoded files, etc.</span></span></li>
<li><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri"></span></span><span style="font-family: Calibri;" face="Calibri"><span style="font-size: small;" size="3">Encoding</span></span></li>
<ul>
<li><span style="font-family: Calibri;" face="Calibri"><span style="font-size: small;" size="3"></span></span><span style="font-family: Calibri;" face="Calibri"><span style="font-size: small;" size="3">How are the files encoded (Code page</span></span></li>
<li><span style="font-family: Calibri;" face="Calibri"><span style="font-size: small;" size="3"></span></span><span style="font-family: Calibri;" face="Calibri"><span style="font-size: small;" size="3">Database Collatio</span></span></li>
<li><span style="font-family: Calibri;" face="Calibri"><span style="font-size: small;" size="3"></span></span><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">Language settings</span></span></li>
</ul>
<li><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri"></span></span><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">Date Formats</span></span></li>
<li><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri"></span></span><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">Number Formats</span></span></li>
</ul>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">My recommendation is to build up a repository where you store the mentioned contracts. This repository can be an Excel workbook or even better a SQL Server database. If the repository contains a comprehensive view of all the contracts and data structures of your sources, you can use the repository as your meta-data for your ETL processes. For example in the data warehouse project I mentioned at the beginning of the article, we generated some of our ETL processes automatically with the information from such a meta-data store.</span></span></p>
<p class="HeadingS3"><strong><span style="font-size: small;" size="3"><span style="color: #365f91;" color="#365f91"><span style="font-family: Arial Black;" face="Arial Black">Historiography </span></span></span></strong></p>
<h4><em><span style="color: #4f81bd;" color="#4f81bd"><span style="font-family: Cambria;" face="Cambria"><span style="font-size: small;" size="3">Data validity period</span></span></span></em></h4>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">In many cases it is important for the ETL Processes to know how to interpret the data. For example if the source systems provide information about the time spans within the data is valid. If this data is important for the target system, detailed information about the meaning of the data fields defining the validity period is required.</span></span></p>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">Here are some questions which should be answerable:</span></span></p>
<ul>
<li><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">How is the validity information provided (TimeFrom &ndash; TimeTo, Timestamp)</span></span></li>
<li><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri"></span></span><span style="font-family: Calibri;" face="Calibri"><span style="font-size: small;" size="3">How is the time information interpretable? E.g. what does a value for ValidTo means? (data is guilty &lt; ValidTo or data is guilty &lt;= ValidTo)</span></span></li>
</ul>
<h3><span style="color: #4f81bd;" color="#4f81bd"><span style="font-family: Cambria;" face="Cambria"><span style="font-size: small;" size="3">Historical data in a data warehouse</span></span></span></h3>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">Data in a Data Warehouse is stored in one of two forms, historically or not historically. Historically stored data can be subdivided into time point related data or time span related data. </span></span></p>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">There are three types how data can be stored in the matter of historiography.</span></span></p>
<ul>
<li><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">Type 1: No history information is stored. Existing data is overridden by new values</span></span></li>
<li><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri"></span></span><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">Type 2: The history of data changes is preserved. Every data row has a valid from and valid to date indicating the time period of the data&rsquo;s validity.</span></span></li>
<li><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri"></span></span><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">Type 3: This type is used for data that is valid for a specific point in time. Every record has a timestamp column indicating the point in time where it is valid.</span></span></li>
</ul>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">The decision what type you use for your data should be made in the design phase of your target database. The important information for the ETL developer is where the history information for Type 2 und Type 3 data comes from.</span></span></p>
<ul>
<li><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">What time information can be used to made up the validity period information</span></span></li>
<li><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri"></span></span><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">How to identify a deleted/invalid data record</span></span></li>
<li><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri"></span></span><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">How to handle validity period information from the source system</span></span></li>
<li><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri"></span></span><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">What does the validity period information mean (e.g. exact definition what a ValidTo date means: &lt;, &lt;=)</span></span></li>
<li><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri"></span></span><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">What granularity is used to define validity periods?</span></span></li>
</ul>
<p><b><i><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">What time information can be used to made up the validity period information</span></span></i></b></p>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">To build up a validity period you need information on what point in time a data change take effect. This point - for example - can be the timestamp of the time when the import process is running. But in most cases this time point is determined by the source system. So you have to find a way to hand this information over from the source system to your ETL process.<b><i></i></b></span></span></p>
<p><b><i><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">How to identify a deleted/invalid data record</span></span></i></b></p>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">The question is how to identify records which are no longer valid in the source system. This can be accomplished by sending the record with a flag indication the record status. If the source system always sends a complete list of valid records, another method can be to match the records from the source system with the records in the target system and set all the records which are not in the source, but in the target to invalid.</span></span></p>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">Setting a record to invalid can mean one of the following things:</span></span></p>
<ul>
<li><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">Delete the record in the target system (not the best choice)</span></span></li>
<li><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri"></span></span><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">Mark the record as invalid (e.g. deleted timestamp in type 1 data, or set ValidToDate in type 2 data)</span></span></li>
</ul>
<p><b><i><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">How to handle validity period information from the source system</span></span></i></b></p>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">Maybe the system where your data comes from already uses validity periods for their data and this information is handed over to the new system. In this case you have to define what this information means to the new system.</span></span></p>
<p><b><i><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">What does the validity period information mean?</span></span></i></b></p>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">Define exactly how validity periods are defined. What does a specific ValidTo date means? In terms of an SQL statement, does ValidTo means &lsquo;&lt;&rsquo; or &lsquo;&lt;=&rsquo;.</span></span></p>
<p><b><i><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">What granularity is used to define validity periods?</span></span></i></b></p>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">In some cases the validity of data is specified on a low granularity, for example on a weekly or a monthly basis. This leaves a lot of space for interpretation. For example a data record which is defined as guilty for January 2010. What does this mean? Is the data guilty starting from the first of February or is the data guilty only for January?&nbsp; All this questions has to be clarified before the development of the ETL processes can start.</span></span></p>
<h2><span style="font-size: medium;" size="4"><span style="color: #4f81bd;" color="#4f81bd"><span style="font-family: Arial Black;" face="Arial Black">Functional Requirements for the ETL processes</span></span></span></h2>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">My recommendation when planning your ETL is to think of all the functional requirements you packages must meet and build up some prototype or template packages. </span></span></p>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">Examples:</span></span></p>
<ul>
<li><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">Transactional behavior / restart ability</span></span></li>
<li><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri"></span></span><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">Logging</span></span></li>
<li><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri"></span></span><span style="font-family: Calibri;" face="Calibri"><span style="font-size: small;" size="3">Batch processing</span></span></li>
</ul>
<h3><span style="color: #4f81bd;" color="#4f81bd"><span style="font-family: Cambria;" face="Cambria"><span style="font-size: small;" size="3">Transactional behavior</span></span></span></h3>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">One important thing to consider is the behavior of your ETL processes in the case of an error, and how you can recover your system into a consistent state after a process abortion. <br />So the first task to complete is to identify the objects affected by your processes. In a DWH project where the task of the processes is to move data from a source to a destination, usually the only affected system is the target database. Fortunately there is a very good, well known mechanism to ensure the consistency of a database: transactions. So to ensure your processes do not leave your destination database in an inconsistent state is to assure all of the work done in the destination runs within one transaction.</span></span></p>
<h3><span style="color: #4f81bd;" color="#4f81bd"><span style="font-family: Cambria;" face="Cambria"><span style="font-size: small;" size="3">Logging</span></span></span></h3>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">Integration Services includes logging features that writes information off all kinds of events during the package execution to a customizable location. This logging information is very technically and it is hard to acquire the required business information out of this logs. So, one thing you should think about, when you are designing your packages is what additional information is useful or required and how/where to log this data. </span></span></p>
<ul>
<li><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">Package Start and Stop time </span></span></li>
<li><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri"></span></span><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">The Batch Name or ID the package execution was part of</span></span></li>
<li><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri"></span></span><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">Package parameters</span></span></li>
<li><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri"></span></span><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">Names of the input files the packages has processed</span></span></li>
<li><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri"></span></span><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">Number of records imported/declined/&hellip;</span></span></li>
</ul>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">To acquire the logging requirements </span></span></p>
<ul>
<li><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">How to analyze package execution errors in the production system</span></span></li>
<li><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri"></span></span><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">How to analyze data errors</span></span></li>
<li><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri"></span></span><span style="font-family: Calibri;" face="Calibri"><span style="font-size: small;" size="3">How to analyze the loading process (plausibility checks)</span></span></li>
</ul>
<ul>
<li><span style="font-family: Calibri;" face="Calibri"><span style="font-size: small;" size="3">Is the amount of loaded data comparable to the last load</span></span></li>
<li><span style="font-family: Calibri;" face="Calibri"><span style="font-size: small;" size="3">Is the load performance stable</span></span></li>
<li><span style="font-family: Calibri;" face="Calibri"><span style="font-size: small;" size="3">Is there an increase in the count of erroneous input data</span></span></li>
</ul>
<p><span style="font-family: Calibri;" face="Calibri"><span style="font-size: small;" size="3">Interview the business specialists and the IT guys which will operate the system to get an comprehensive list of all the questions which should be answerable by the logged data.</span></span></p>
<h3><span style="color: #4f81bd;" color="#4f81bd"><span style="font-family: Cambria;" face="Cambria"><span style="font-size: small;" size="3">Batch processing</span></span></span></h3>
<p><span style="font-family: Calibri;" face="Calibri"><span style="font-size: small;" size="3">Usually, data delivered from a source system is provided in multiple parts (e.g. data files or data tables), and this parts are related to each other, and it is necessary to process this parts in one batch. Considering this requirement is very important in the design phase of your ETL processes, because the single processing units (ETL packages) must be aware of the batch they are part of. </span></span></p>
<p><span style="font-family: Calibri;" face="Calibri"><span style="font-size: small;" size="3">For example a source system which provides customers data, and the data is split into multiple parts. One part (source file) contains information about the customers personal data (name, age, &hellip;). A second part contains the details about the customers contact information (email addresses, phone numbers, &hellip;). Assume that we have 2 SSIS packages to import the customer data in this simple example. It is obvious that the packages belong to each other and that the package which imports the customers personal data must be run before the package importing the customers personal data. This is a very simplified example where it is necessary to process the packages in a batch, which distinct dependencies between the members of the batch.</span></span></p>
<ul>
<li><span style="font-family: Calibri;" face="Calibri"><span style="font-size: small;" size="3">Members of a batch are related to each other</span></span></li>
<li><span style="font-family: Calibri;" face="Calibri"><span style="font-size: small;" size="3">Batches should be as small as possible to minimize dependencies.</span></span></li>
<li><span style="font-family: Calibri;" face="Calibri"><span style="font-size: small;" size="3">All related parts must be in one batch</span></span></li>
<li><span style="font-family: Calibri;" face="Calibri"><span style="font-size: small;" size="3">Package executions should be assigned to a distinct batch (batch identifier)</span></span></li>
<li><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">Logging information should include information about the batch (e.g. a batch identifier)</span></span></li>
</ul>
<h2><span style="font-size: medium;" size="4"><span style="color: #4f81bd;" color="#4f81bd"><span style="font-family: Arial Black;" face="Arial Black">Bulk load</span></span></span></h2>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">A rule of thumb is that you should use bulk inserts whenever possible. The performance improvement can be tremendous compared to non-bulk inserts when you are inserting more than just a few hundreds of records. </span></span></p>
<ul>
<li><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">Use table looks</span></span></li>
<li><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri"></span></span><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">Parallel writes into one target table must be avoided</span></span></li>
<li><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri"></span></span><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">If your target tables are connected with foreign keys, you have to pay special attention to the dependencies of your ETL processes (details in the next chapter).</span></span></li>
</ul>
<h2><span style="font-size: medium;" size="4"><span style="color: #4f81bd;" color="#4f81bd"><span style="font-family: Arial Black;" face="Arial Black">DWH and Foreign-Key constraints</span></span></span></h2>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">This chapter is not a comprehensive essay about foreign key constraints. I just want to write down some of my experiences with this topic.</span></span></p>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">The scenario is form a project I was involved. My task was to load data from data files into a database with a normalized data schema. The nature of a normalized database schema is that there are many relatively small tables (in the sense of number of columns) which are heavily related to each other. These relationships must be addressed when the database is loaded with data. For example the customer base table must be loaded before the customer details table and so on. The rule of thumb is that if there is a dependency between to tables in the data schema, this dependency must be addressed when loading the data into the database. In addition to this rule there might be some more dependencies to consider. For example if you are using bulk inserts to write data into the target tables. </span></span></p>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">Here is an example how bulk inserts can affect the ordering of your ETL processes.</span></span></p>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">In the example there are three tables in the target database. One ETL process &ndash; SSIS package &ndash; exits to load each of the tables. The tables are related to each other, as you can see in the picture.</span></span></p>
<p><span style="font-family: Calibri; font-size: small;" face="Calibri" size="3"></span></p>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">When you use a bulk insert operation to insert data into the CustomerCountry table you should not bulk insert data into CustomerAddress table at the same time. Inserting in both tables at the same time could end up in an erroneous behavior in one of the insert tasks. Bulk insert operations require that the schema of the involved tables and objects stay the same during the whole operation. But bulk inserting into a table with a constraint will change the meta-data of the constraint. This change is threaded as a schema change of the constraint in the referenced table. So if a second bulk insert operation is running even on a different table, this operation is may be ended with an error message.</span></span></p>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">As you can see in the example you have to consider a lot of dependencies, when you design your package execution plan. So, not using foreign key constraint can make your work easier and your load process faster because you can load your warehouse with more parallelism.</span></span></p>]]></content:encoded>
    </item>
    <item>
      <title>SSIS – Programmatically connect DataFlow components</title>
      <link>https://docs.microsoft.com/archive/blogs/christophputz/ssis-programmatically-connect-dataflow-components</link>
      <pubDate>Mon, 06 Jun 2011 11:09:12 GMT</pubDate>
      <dc:creator><![CDATA[Christoph Putz]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/christophputz/2011/06/06/ssis-programmatically-connect-dataflow-components/</guid>
      <description><![CDATA[In this part of my series of blogs about dynamically modifying SSIS Packages I describe how to use...]]></description>
      <content:encoded><![CDATA[<p><span style="font-size: small;"><span style="font-family: Calibri;">In this part of my series of blogs about dynamically modifying SSIS Packages I describe how to use the SSIS programming API to create and connect data flow components.</span></span></p>
<p><span style="font-size: small;"><span style="font-family: Calibri;">DataFlow Components have input or/and output column collections depending on the type of component. Components like DataSources do not have an input collection whilst destination component do not have a destination collection. </span></span></p>
<p><span style="font-size: small;"><span style="font-family: Calibri;">If you already have built your data flow you can examine the components columns and how they are connected to other components by querying the components input and output column collection.</span></span></p>
<p><span style="font-size: small;"><span style="font-family: Calibri;">As you may know data flow components are interconnected through paths. A path describes the flow of data from the sources through transformations to the destinations. Programmatically a path is represented by a IDTSPath100 object. Unless a component isn&rsquo;t connected by a path it is not possible to add any columns to its input column collection. So the first step after creating the data flow components is to interconnect them with paths.</span></span></p>
<p><span style="font-size: small;"><span style="font-family: Calibri;">Here is an example how you can connect two components with an IDTSPath100 object:</span></span></p>
<p class="Code"><span style="font-size: x-small;"><span style="font-family: Courier New;">// Create the source component.&nbsp; <br /></span></span><span style="font-size: x-small;"><span style="font-family: Courier New;">IDTSComponentMetaData100 sourceComponent =<br /></span></span><span style="font-size: x-small;"><span style="font-family: Courier New;">dataFlowTask.ComponentMetaDataCollection.New();<br /></span></span><span style="font-size: x-small;"><span style="font-family: Courier New;">sourceComponent.ComponentClassID = "DTSAdapter.OleDbSource";<br /></span></span><span style="font-size: x-small;"><span style="font-family: Courier New;">CManagedComponentWrapper srcDesignTime = source.Instantiate();<br /></span></span><span style="font-size: x-small;"><span style="font-family: Courier New;">srcDesignTime.ProvideComponentProperties();</span></span></p>
<p class="Code"><span style="font-family: Courier New; font-size: x-small;">&nbsp;</span></p>
<p class="Code"><span style="font-size: x-small;"><span style="font-family: Courier New;">// Create the destination component.<br /></span></span><span style="font-size: x-small;"><span style="font-family: Courier New;">IDTSComponentMetaData100 destination =<br /></span></span><span style="font-size: x-small;"><span style="font-family: Courier New;">dataFlowTask.ComponentMetaDataCollection.New();<br /></span></span><span style="font-size: x-small;"><span style="font-family: Courier New;">destination.ComponentClassID = "DTSAdapter.OleDbDestination";<br /></span></span><span style="font-size: x-small;"><span style="font-family: Courier New;">CManagedComponentWrapper destDesignTime = destination.Instantiate();<br /></span></span><span style="font-size: x-small;"><span style="font-family: Courier New;">destDesignTime.ProvideComponentProperties();</span></span></p>
<p class="Code"><span style="font-family: Courier New; font-size: x-small;">&nbsp;</span></p>
<p class="Code"><span style="font-size: x-small;"><span style="font-family: Courier New;">// Create the path.<br /></span></span><span style="font-size: x-small;"><span style="font-family: Courier New;">IDTSPath100 path = dataFlowTask.PathCollection.New();<br /></span></span><span style="font-size: x-small;"><span style="font-family: Courier New;">path.AttachPathAndPropagateNotifications(source.OutputCollection[0],<br /></span></span><span style="font-size: x-small;"><span style="font-family: Courier New;">destination.InputCollection[0]);<br /></span></span></p>
<p><span style="font-size: small;"><span style="font-family: Calibri;">To retrieve the possible input columns for a component, one can use the GetVirtualInput method of the InputColumnCollection object.</span></span></p>
<p class="Code"><span style="font-size: x-small;"><span style="font-family: Courier New;">IDTSInput100 input = destination.InputCollection[0];<br />IDTSVirtualInput100 virtualInput = input.GetVirtualInput();</span></span><span style="font-family: Courier New; font-size: x-small;">&nbsp;</span></p>
<p><span style="font-size: small;"><span style="font-family: Calibri;">The virtual input column collection contains all the possible columns from an upstream component.</span></span></p>
<p><span style="font-size: small;"><span style="font-family: Calibri;">This example code shows how to iterate over all input columns and connect them to the destination component.</span></span></p>
<p class="Code"><span style="font-size: x-small;"><span style="font-family: Courier New;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foreach (IDTSVirtualInputColumn100 column in virtualInput.VirtualInputColumnCollection)<br /></span></span><span style="font-size: x-small;"><span style="font-family: Courier New;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br /></span></span><span style="font-size: x-small;"><span style="font-family: Courier New;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; destDesignTime.SetUsageType(<br /></span></span><span style="font-size: x-small;"><span style="font-family: Courier New;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; input.ID, virtualInput, column.LineageID, DTSUsageType.UT_READONLY);<br /></span></span><span style="font-size: x-small;"><span style="font-family: Courier New;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br /></span></span></p>]]></content:encoded>
    </item>
    <item>
      <title>Move an ASP.NET application to the cloud</title>
      <link>https://docs.microsoft.com/archive/blogs/christophputz/move-an-asp-net-application-to-the-cloud</link>
      <pubDate>Thu, 26 May 2011 00:46:03 GMT</pubDate>
      <dc:creator><![CDATA[Christoph Putz]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/christophputz/2011/05/26/move-an-asp-net-application-to-the-cloud/</guid>
      <description><![CDATA[&nbsp;This is a step by step guide to move an existing ASP.NET Web Application to the...]]></description>
      <content:encoded><![CDATA[<h1><strong>&nbsp;<span style="font-size: small;">This is a step by step guide to move an existing ASP.NET Web Application to the Cloud.</span></strong></h1>
<ol>
<li>&nbsp;<span style="font-size: small;"><span style="font-family: Calibri;">Add a cloud service project to your existing solution</span></span> <ol>
<li><span style="font-size: small;"><span style="font-family: Calibri;">Solution Explorer right click your solution and select &lsquo;Add -&gt; New project &hellip;&rsquo;</span></span></li>
<li><span style="font-size: small;"><span style="font-family: Calibri;">In the Add New Project dialog select Installed Templates &ndash;&gt; Cloud -&gt; Windows Azure Project template </span></span></li>
<li><span style="font-size: small;"><span style="font-family: Calibri;">Choose name and press the OK button. </span></span></li>
<li><span style="font-size: small;"><span style="font-family: Calibri;">Don&rsquo;t add a role in the New Windows Azure dialog. The existing ASP.NET web application will be used as a web role.</span></span></li>
</ol></li>
<li><span style="font-size: small;"><span style="font-family: Calibri;">Associate the ASP.NET project to the cloud project </span></span><ol>
<li><span style="font-size: small;"><span style="font-family: Calibri;">Right click Windows Azure Project Role folder -&gt; Add -&gt; Web Role Project in solution ...</span></span></li>
<li>In the Associate with Role Project dialog, select your web project and click OK.</li>
</ol></li>
<li>Add references to the required assemblies. <ol>
<li>Right click web application project and select add reference. Add references to the following assemblies:<ol>
<li>Microsoft.WindowsAzure.Diagnostics</li>
<li>Microsoft.WindowsAzure.ServiceRuntime</li>
<li>Microsoft.WindowsAzure.StorageClient</li>
</ol></li>
</ol></li>
<li>Enable diagnostic logging by adding the following section to your Web.config.<br /><span style="font-family: Courier New;">&lt;system.diagnostics&gt;<br /></span><span style="font-family: Courier New;">&nbsp;&nbsp;&lt;trace autoflush="false" indentsize="4"&gt;</span><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="font-family: Courier New;">&lt;listeners&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-family: Courier New;">&lt;add name="AzureDiagnostics" type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /&gt;<br />&nbsp;&nbsp;&nbsp; </span><span style="font-family: Courier New;">&lt;/listeners&gt;<br />&nbsp;&nbsp; </span><span style="font-family: Courier New;">&lt;/trace&gt;<br /></span><span style="font-family: Courier New;">&lt;/system.diagnostics&gt;</span></li>
<li>Modify Global.asax <ol>
<li>Set configuration settings publisher. Add the following code snippet to the Application_Start procedure:<br /><span style="font-family: Courier New;">Microsoft.WindowsAzure.CloudStorageAccount.SetConfigurationSettingPublisher((configName, configSetter) =&gt;<br /></span><span style="font-family: Courier New;">{<br /></span><span style="font-family: Courier New;">&nbsp;&nbsp;&nbsp; configSetter(RoleEnvironment.GetConfigurationSettingValue(configName));<br /></span><span style="font-family: Courier New;">&nbsp; });</span><span style="font-family: Calibri; font-size: small;">&nbsp;<br /></span><span style="font-size: small;"><span style="font-family: Calibri;">In addition to this, you have to add using statements for the following namespaces:<br /></span></span><span style="font-family: Courier New;">&nbsp;&nbsp; <br />&nbsp;&nbsp; using Microsoft.WindowsAzure;<br /></span><span style="font-family: Courier New;">&nbsp;&nbsp; using Microsoft.WindowsAzure.ServiceRuntime;</span></li>
</ol></li>
<li><span style="font-size: small;"><span style="font-family: Calibri;">Deploy your solution to the cloud.</span></span></li>
</ol>
<p class="Code" style="padding-left: 30px;"><span style="font-size: small;"><span style="font-family: Calibri;">&nbsp;</span></span></p>]]></content:encoded>
    </item>
    <item>
      <title>SSIS - programmatically add an aggregate component</title>
      <link>https://docs.microsoft.com/archive/blogs/christophputz/ssis-programmatically-add-an-aggregate-component</link>
      <pubDate>Wed, 09 Feb 2011 11:17:25 GMT</pubDate>
      <dc:creator><![CDATA[Christoph Putz]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/christophputz/2011/02/09/ssis-programmatically-add-an-aggregate-component/</guid>
      <description><![CDATA[Intro
In this part of my series of blogs about dynamically modifying SSIS Packages I describe how...]]></description>
      <content:encoded><![CDATA[<h1>Intro</h1>
<p>In this part of my series of blogs about dynamically modifying SSIS Packages I describe how to programmatically add or modify an Aggregate component.</p>
<h1>Sample</h1>
<p>The following code snippet shows how to add and modify an aggregate component by implementing the following steps</p>
<p>1. Add a new aggregate component to a data flow tasks.<br />2. Link the newly created component to another component in your data flow (this step is not included in the code example)<br />3. Delete the input and output column collection. This step is not necessary if you created a new aggregate component as mentioned in step 1. Do this step only in the case you modify an existing data flow, with an existing <br />ggregate component where you want to change the behavior by exchanging the columns in the aggregate.<br />4. Add input columns to the input column collection from the virtual input collection<br />5. Create output columns.<br />6. Modify the output columns properties</p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">// Step 1: create aggregate task<br /></span><span style="font-family: courier new,courier;">IDTSComponentMetaData100 aggregate =<br /></span><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dataFlowTask.ComponentMetaDataCollection.New();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; aggregate.ComponentClassID = "DTSTransform.Aggregate.2";</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"></span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">// Step 2:<br /></span><span style="font-family: courier new,courier;">// TODO:<br /></span><span style="font-family: courier new,courier;">// link the component to the upstream component here<br /></span><span style="font-family: courier new,courier;">CManagedComponentWrapper componentWrapper = component.Instantiate();<br /></span><span style="font-family: courier new,courier;">componentWrapper.AcquireConnections(null);<br /></span><span style="font-family: courier new,courier;"><br />// Step 3:<br /></span><span style="font-family: courier new,courier;">// do this if you modify an existing aggregate task. You don't have<br /></span><span style="font-family: courier new,courier;">// to delete the input and output collection if you just created the<br /></span><span style="font-family: courier new,courier;">// component with the code above.<br /></span><span style="font-family: courier new,courier;">component.InputCollection[0].InputColumnCollection.RemoveAll();<br /></span><span style="font-family: courier new,courier;">component.OutputCollection[0].OutputColumnCollection.RemoveAll();<br /></span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">// Step 4:<br /></span><span style="font-family: courier new,courier;">// get the input/output and virutal column collection of the component<br /></span><span style="font-family: courier new,courier;">IDTSVirtualInput100 virtualInput = component.InputCollection[0].GetVirtualInput();<br /></span><span style="font-family: courier new,courier;">IDTSOutput100 outputCollection = component.OutputCollection[0];<br /></span><span style="font-family: courier new,courier;">IDTSInput100 inputCollection = component.InputCollection[0];<br />&nbsp;</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"></span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">// add all the columns witch are involved in the aggregation to the<br /></span><span style="font-family: courier new,courier;">// component by retrieving the columns linage id from the virtual input<br /></span><span style="font-family: courier new,courier;">// collection and adding the column to the input column collection by calling<br />// the SetUsageType method.</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">int sourceColumnLineageId = virtualInput.VirtualInputColumnCollection[name].LineageID;&nbsp;</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">componentWrapper.SetUsageType(<br /></span><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;inputCollection.ID,<br /></span><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;virtualInput,<br /></span><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sourceColumnLineageId,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DTSUsageType.UT_READONLY);</span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;"></span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">// Step 5:<br /></span><span style="font-family: courier new,courier;">// create a new output column<br />IDTSOutputColumn100 newOutputColumn = componentWrapper.InsertOutputColumnAt(outputCollection.ID, 0, "ColumnName", string.Empty);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">// set the data type porperties to the same values as these of the input column&nbsp;&nbsp; newOutputColumn.SetDataTypeProperties(virtualInput.VirtualInputColumnCollection[name].DataType, virtualInput.VirtualInputColumnCollection["ColumnName"].Length, 0, 0, virtualInput.VirtualInputColumnCollection["ColumnName"].CodePage);<br /></span></p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">newOutputColumn.MappedColumnID = 0;<br /></span></p>
<p style="padding-left: 120px;"><span style="font-family: courier new,courier;">// Step 6<br /></span><span style="font-family: courier new,courier;">// modify the properties of the newly created column<br /></span><span style="font-family: courier new,courier;">for (int i = 0; i &lt; newOutputColumn.CustomPropertyCollection.Count; i++)<br /></span><span style="font-family: courier new,courier;">{<br /></span><span style="font-family: courier new,courier;">IDTSCustomProperty100 property = newOutputColumn.CustomPropertyCollection[i];<br /></span><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; switch (property.Name)<br /></span><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br /></span><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case "AggregationColumnId":<br /></span><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; property.Value = sourceColumnLineageId;<br /></span><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<br /></span><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case "AggregationType":<br /></span><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; property.Value = 0;<br /></span><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<br /></span><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case "IsBig":<br /></span><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; property.Value = 0;<br /></span><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<br /></span><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case "AggregationComparisonFlags":<br /></span><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; property.Value = 0;<br /></span><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<br /></span><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br /></span><span style="font-family: courier new,courier;">}<br /></span>&nbsp;</p>
<p>After adding all the columns to the component which are involved in the aggregation, you may also want to add a column which holds the number of items in each group. This is done by adding another output column to the aggregate.</p>
<p style="padding-left: 30px;"><span style="font-family: courier new,courier;">IDTSOutputColumn100 newOutputColumn = componentWrapper.InsertOutputColumnAt(outputCollection.ID, 0, "Count all", string.Empty);<br />newOutputColumn.SetDataTypeProperties(DataType.DT_UI4, 0, 0, 0, 0);<br />newOutputColumn.MappedColumnID = 0;<br />&nbsp;<br />for (int i = 0; i &lt; newOutputColumn.CustomPropertyCollection.Count; i++)<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IDTSCustomProperty100 property = newOutputColumn.CustomPropertyCollection[i];<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; switch (property.Name)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case "AggregationColumnId":<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; property.Value = 0;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case "AggregationType":<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; property.Value = 2;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case "IsBig":<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; property.Value = 0;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case "AggregationComparisonFlags":<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; property.Value = 0;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />}</span></p>
<p>&nbsp;</p>
<h2>Aggregate column properties</h2>
<p>These are the possible values of the aggregate properties:</p>
<table sizset="1" sizcache="40" cellpadding="0" cellspacing="0" border="1">
<tbody sizset="1" sizcache="40">
<tr>
<td width="226" valign="top">
<p>Property</p>
</td>
<td width="277" valign="top">
<p>Description</p>
</td>
</tr>
<tr>
<td width="226" valign="top">
<p>AggregationColumnId</p>
</td>
<td width="277" valign="top">
<p>LinageID of a column that participates in aggregate functions</p>
</td>
</tr>
<tr sizset="1" sizcache="40">
<td width="226" valign="top">
<p>AggregateType</p>
</td>
<td sizset="1" sizcache="40" width="277" valign="top">
<table cellpadding="0" cellspacing="0" border="1">
<tbody>
<tr>
<td width="131" valign="top">
<p>Function</p>
</td>
<td width="131" valign="top">
<p>Value</p>
</td>
</tr>
<tr>
<td width="131" valign="top">
<p>Average</p>
</td>
<td width="131" valign="top">
<p>0</p>
</td>
</tr>
<tr>
<td width="131" valign="top">
<p>Count</p>
</td>
<td width="131" valign="top">
<p>1</p>
</td>
</tr>
<tr>
<td width="131" valign="top">
<p>CountAll</p>
</td>
<td width="131" valign="top">
<p>2</p>
</td>
</tr>
<tr>
<td width="131" valign="top">
<p>Count distinct</p>
</td>
<td width="131" valign="top">
<p>3</p>
</td>
</tr>
<tr>
<td width="131" valign="top">
<p>Group by</p>
</td>
<td width="131" valign="top">
<p>4</p>
</td>
</tr>
<tr>
<td width="131" valign="top">
<p>Maximum</p>
</td>
<td width="131" valign="top">
<p>5</p>
</td>
</tr>
<tr>
<td width="131" valign="top">
<p>Sum</p>
</td>
<td width="131" valign="top">
<p>6</p>
</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
</td>
</tr>
<tr>
<td width="226" valign="top">
<p>IsBig</p>
</td>
<td width="277" valign="top">
<p>A value that indicates whether the column contains a value larger than 4 billion or a value with more precision than a double-precision floating-point value. The value can be 0 or 1. 0 indicates that <b>IsBig</b> is <b>False</b> and the column does not contain a large value or precise value. The default value of this property is 1.</p>
<p>&nbsp;</p>
</td>
</tr>
<tr sizset="2" sizcache="40">
<td width="226" valign="top">
<p>AggregationComparisonFlags</p>
</td>
<td sizset="2" sizcache="40" width="277" valign="top">
<p>&nbsp;A value that specifies how the Aggregate transformation compares string data in a column.</p>
<table align="left" cellpadding="0" cellspacing="0" border="1">
<tbody>
<tr>
<td width="131" valign="top">
<p>Function</p>
</td>
<td width="131" valign="top">
<p>Value</p>
</td>
</tr>
<tr>
<td width="131" valign="top">
<p>Ignore case</p>
</td>
<td width="131" valign="top">
<p>0</p>
</td>
</tr>
<tr>
<td width="131" valign="top">
<p>Ignore kana type</p>
</td>
<td width="131" valign="top">
<p>1</p>
</td>
</tr>
<tr>
<td width="131" valign="top">
<p>Ignore character width</p>
</td>
<td width="131" valign="top">
<p>2</p>
</td>
</tr>
<tr>
<td width="131" valign="top">
<p>Ignore nonspacing characters</p>
</td>
<td width="131" valign="top">
<p>3</p>
</td>
</tr>
<tr>
<td width="131" valign="top">
<p>Ignore symbols</p>
</td>
<td width="131" valign="top">
<p>4</p>
</td>
</tr>
<tr>
<td width="131" valign="top">
<p>Sort punctuation as symbols</p>
</td>
<td width="131" valign="top">
<p>5</p>
</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>Windows Phone 7 - Dynamically load XAML</title>
      <link>https://docs.microsoft.com/archive/blogs/christophputz/windows-phone-7-dynamically-load-xaml</link>
      <pubDate>Sun, 24 Oct 2010 12:33:00 GMT</pubDate>
      <dc:creator><![CDATA[Christoph Putz]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/christophputz/2010/10/24/windows-phone-7-dynamically-load-xaml/</guid>
      <description><![CDATA[Sometimes it is necessary to load an element like a shape dynamically from an file, resource or...]]></description>
      <content:encoded><![CDATA[<p class="MsoNormal"><span lang="EN-US" style="mso-ansi-language: EN-US;"><span style="font-size: small;"><span style="font-family: Calibri;">Sometimes it is necessary to load an element like a shape dynamically from an file, resource or directly from a string into the corresponding API classes.<o:p></o:p></span></span></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-ansi-language: EN-US;"><span style="font-size: small;"><span style="font-family: Calibri;">In Silverlight for Windows Phone 7 this can be done with the use of the XamlReader Class. This class can be found in the System.Windows.Markup namespace.<o:p></o:p></span></span></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-ansi-language: EN-US;"><span style="font-size: small;"><span style="font-family: Calibri;">With the use of this class it&rsquo;s very easy to create in memory representations of XAML object you created in tools like expression blend. In my example I created an ellipsis with a gradient fill and a gradient stroke. <o:p></o:p></span></span></span></p>
<p class="MsoNoSpacing"><span lang="EN-US" style="font-family: 'Courier New'; font-size: 8pt; mso-ansi-language: EN-US;">&lt;Ellipse Grid.Row="1" Height="40" VerticalAlignment="Top" HorizontalAlignment="Left" Width="40"&gt;<br /></span><span lang="EN-US" style="font-family: 'Courier New'; font-size: 8pt; mso-ansi-language: EN-US;">&lt;Ellipse.Stroke&gt;<br /></span><span lang="EN-US" style="font-family: 'Courier New'; font-size: 8pt; mso-ansi-language: EN-US;"><span style="mso-tab-count: 2;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>&lt;LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"&gt;<br /></span><span lang="EN-US" style="font-family: 'Courier New'; font-size: 8pt; mso-ansi-language: EN-US;"><span style="mso-tab-count: 3;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>&lt;GradientStop Color="#FF03063D" Offset="0"/&gt;<br /></span><span lang="EN-US" style="font-family: 'Courier New'; font-size: 8pt; mso-ansi-language: EN-US;"><span style="mso-tab-count: 3;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>&lt;GradientStop Color="#FF333CD8" Offset="1"/&gt;<br /></span><span lang="EN-US" style="font-family: 'Courier New'; font-size: 8pt; mso-ansi-language: EN-US;"><span style="mso-tab-count: 2;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>&lt;/LinearGradientBrush&gt;<br /></span><span lang="EN-US" style="font-family: 'Courier New'; font-size: 8pt; mso-ansi-language: EN-US;"><span style="mso-tab-count: 1;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>&lt;/Ellipse.Stroke&gt;<br /></span><span lang="EN-US" style="font-family: 'Courier New'; font-size: 8pt; mso-ansi-language: EN-US;"><span style="mso-tab-count: 1;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>&lt;Ellipse.Fill&gt;<br /></span><span lang="EN-US" style="font-family: 'Courier New'; font-size: 8pt; mso-ansi-language: EN-US;"><span style="mso-tab-count: 2;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>&lt;RadialGradientBrush&gt;<br /></span><span lang="EN-US" style="font-family: 'Courier New'; font-size: 8pt; mso-ansi-language: EN-US;"><span style="mso-tab-count: 3;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>&lt;GradientStop Color="#FF06114D" Offset="1"/&gt;<br /></span><span lang="EN-US" style="font-family: 'Courier New'; font-size: 8pt; mso-ansi-language: EN-US;"><span style="mso-tab-count: 3;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>&lt;GradientStop Color="#FF6F72FF"/&gt;<br /></span><span lang="EN-US" style="font-family: 'Courier New'; font-size: 8pt; mso-ansi-language: EN-US;"><span style="mso-tab-count: 2;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>&lt;/RadialGradientBrush&gt;<br /></span><span lang="EN-US" style="font-family: 'Courier New'; font-size: 8pt; mso-ansi-language: EN-US;"><span style="mso-tab-count: 1;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>&lt;/Ellipse.Fill&gt;<br /></span><span lang="EN-US" style="font-family: 'Courier New'; font-size: 8pt; mso-ansi-language: EN-US;">&lt;/Ellipse&gt;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-ansi-language: EN-US;"><o:p><span style="font-family: Calibri; font-size: small;"></span></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-ansi-language: EN-US;"><span style="font-size: small;"><span style="font-family: Calibri;">If you try to load this xaml snippet with XamlReader.Load you will receive an error message. There are a view things you have to do with the snippet first.<o:p></o:p></span></span></span></p>
<ol>
<li>
<div class="MsoListParagraphCxSpFirst"><span lang="EN-US" style="mso-ansi-language: EN-US;"><span style="font-size: small;"><span style="font-family: Calibri;">Remove the Grid.Row attribute.</span></span></span></div>
</li>
<li>
<div class="MsoListParagraphCxSpFirst"><span lang="EN-US" style="mso-ansi-language: EN-US;"><span style="font-size: small;"><span style="font-family: Calibri;"></span></span></span><span lang="EN-US" style="mso-ansi-language: EN-US;"><span style="font-size: small;"><span style="font-family: Calibri;">Add the required namespaces to the root (Ellipse) element</span></span></span></div>
</li>
<li>
<div class="MsoListParagraphCxSpFirst"><span lang="EN-US" style="mso-ansi-language: EN-US;"><span style="font-size: small;"><span style="font-family: Calibri;"></span></span></span><span lang="EN-US" style="mso-ansi-language: EN-US;"><span style="font-size: small;"><span style="font-family: Calibri;">Remove or ajust position information <o:p></o:p></span></span></span></div>
</li>
</ol>
<p class="MsoNormal"><span lang="EN-US" style="mso-ansi-language: EN-US;"><span style="font-size: small;"><span style="font-family: Calibri;">After the modifications the XAML looks like this:<o:p></o:p></span></span></span></p>
<p class="MsoNoSpacing"><span lang="EN-US" style="font-family: 'Courier New'; font-size: 8pt; mso-ansi-language: EN-US;">&lt;Ellipse xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\" xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\" Height=\"40\" VerticalAlignment=\"Top\" HorizontalAlignment=\"Left\" Width=\"40\"&gt;<br /></span><span lang="EN-US" style="font-family: 'Courier New'; font-size: 8pt; mso-ansi-language: EN-US;"><span style="mso-tab-count: 2;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>&lt;Ellipse.Stroke&gt;<br /></span><span lang="EN-US" style="font-family: 'Courier New'; font-size: 8pt; mso-ansi-language: EN-US;"><span style="mso-tab-count: 2;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>&lt;LinearGradientBrush EndPoint=\"0,1\" StartPoint=\"0.5,0\"&gt;<br /></span><span lang="EN-US" style="font-family: 'Courier New'; font-size: 8pt; mso-ansi-language: EN-US;"><span style="mso-tab-count: 3;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>&lt;GradientStop Color=\"#FF02076E\" Offset=\"0\"/&gt;<br /></span><span lang="EN-US" style="font-family: 'Courier New'; font-size: 8pt; mso-ansi-language: EN-US;"><span style="mso-tab-count: 3;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>&lt;GradientStop Color=\"#FF272FBA\" Offset=\"1\"/&gt;&lt;/LinearGradientBrush&gt;<br /></span><span lang="EN-US" style="font-family: 'Courier New'; font-size: 8pt; mso-ansi-language: EN-US;"><span style="mso-tab-count: 1;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="mso-tab-count: 1;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>&lt;/Ellipse.Stroke&gt;<br /></span><span lang="EN-US" style="font-family: 'Courier New'; font-size: 8pt; mso-ansi-language: EN-US;"><span style="mso-tab-count: 1;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="mso-tab-count: 1;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>&lt;Ellipse.Fill&gt;<br /></span><span lang="EN-US" style="font-family: 'Courier New'; font-size: 8pt; mso-ansi-language: EN-US;"><span style="mso-tab-count: 2;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>&lt;RadialGradientBrush<span style="mso-spacerun: yes;">&nbsp; </span>GradientOrigin=\"0.35,0.65\"&gt;<br /></span><span lang="EN-US" style="font-family: 'Courier New'; font-size: 8pt; mso-ansi-language: EN-US;"><span style="mso-tab-count: 3;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>&lt;GradientStop Color=\"#FF06114D\" Offset=\"1\"/&gt;<br /></span><span lang="EN-US" style="font-family: 'Courier New'; font-size: 8pt; mso-ansi-language: EN-US;"><span style="mso-tab-count: 3;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>&lt;GradientStop Color=\"#FF6F72FF\"/&gt;&lt;/RadialGradientBrush&gt;<br /></span><span lang="EN-US" style="font-family: 'Courier New'; font-size: 8pt; mso-ansi-language: EN-US;"><span style="mso-tab-count: 1;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="mso-tab-count: 1;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>&lt;/Ellipse.Fill&gt;<br /></span><span lang="EN-US" style="font-family: 'Courier New'; font-size: 8pt; mso-ansi-language: EN-US;">&lt;/Ellipse&gt;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-ansi-language: EN-US;"><o:p><span style="font-family: Calibri; font-size: small;">&nbsp;</span></o:p></span><span lang="EN-US" style="mso-ansi-language: EN-US;"><span style="font-size: small;"><span style="font-family: Calibri;">Now the XAML is in the right shape and we can create the Ellipse objects with the following statement:<o:p></o:p></span></span></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span lang="EN-US" style="font-family: Consolas; color: #2b91af; font-size: 8pt; mso-ansi-language: EN-US;">Ellipse</span><span lang="EN-US" style="font-family: Consolas; font-size: 8pt; mso-ansi-language: EN-US;"> ellipse = (<span style="color: #2b91af;">Ellipse</span>)<span style="color: #2b91af;">XamlReader</span>.Load(<span style="color: #a31515;">"&lt;Ellipse xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\" xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\" Height=\"40\" VerticalAlignment=\"Top\" HorizontalAlignment=\"Left\" Width=\"40\"&gt;&lt;Ellipse.Stroke&gt;&lt;LinearGradientBrush EndPoint=\"0,1\" StartPoint=\"0.5,0\"&gt;&lt;GradientStop Color=\"#FF02076E\" Offset=\"0\"/&gt;&lt;GradientStop Color=\"#FF272FBA\" Offset=\"1\"/&gt;&lt;/LinearGradientBrush&gt;&lt;/Ellipse.Stroke&gt;&lt;Ellipse.Fill&gt;&lt;RadialGradientBrush<span style="mso-spacerun: yes;">&nbsp; </span>GradientOrigin=\"0.35,0.65\"&gt;&lt;GradientStop Color=\"#FF06114D\" Offset=\"1\"/&gt;&lt;GradientStop Color=\"#FF6F72FF\"/&gt;&lt;/RadialGradientBrush&gt;&lt;/Ellipse.Fill&gt;&lt;/Ellipse&gt;"</span>);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-ansi-language: EN-US;"><o:p><span style="font-family: Calibri; font-size: small;">&nbsp;</span></o:p></span><span lang="EN-US" style="mso-ansi-language: EN-US;"><span style="font-size: small;"><span style="font-family: Calibri;">In the example the XAML for the ellipse object is hard coded but in an real project you can store it in the project resources and load it from there.<o:p></o:p></span></span></span></p>
<p class="MsoNormal" style="padding-left: 30px;"><span lang="EN-US" style="font-family: Consolas; font-size: 8pt; mso-ansi-language: EN-US;"><span style="font-family: Consolas; color: blue; font-size: 8pt;">string</span><span style="font-family: Consolas; font-size: 8pt;"> ellipseXAML;<br /></span></span><span lang="EN-US" style="font-family: Consolas; font-size: 8pt; mso-ansi-language: EN-US;">System.IO.<span style="color: #2b91af;">Stream</span> st = <span style="color: blue;">this</span>.GetType().Assembly.GetManifestResourceStream(<span style="color: #a31515;">"Ellipse.xaml"</span>);<br /></span><span lang="EN-US" style="font-family: Consolas; color: blue; font-size: 8pt; mso-ansi-language: EN-US;">using</span><span lang="EN-US" style="font-family: Consolas; font-size: 8pt; mso-ansi-language: EN-US;">(<span style="color: #2b91af;">StreamReader</span> reader = <span style="color: blue;">new</span> <span style="color: #2b91af;">StreamReader</span>(st) ) <br /></span><span lang="EN-US" style="font-family: Consolas; font-size: 8pt; mso-ansi-language: EN-US;">{<br /></span><span lang="EN-US" style="font-family: Consolas; font-size: 8pt; mso-ansi-language: EN-US;"><span style="mso-tab-count: 1;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-family: Consolas; font-size: 8pt;">ellipseXAML = reader.ReadToEnd();<br /></span><span style="font-family: Consolas; font-size: 8pt;">}</span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-ansi-language: EN-US;"><o:p><span style="font-family: Calibri; font-size: small;">&nbsp;</span></o:p></span></p>]]></content:encoded>
    </item>
    <item>
      <title>Recursive delete procedure</title>
      <link>https://docs.microsoft.com/archive/blogs/christophputz/recursive-delete-procedure</link>
      <pubDate>Wed, 06 Oct 2010 06:32:55 GMT</pubDate>
      <dc:creator><![CDATA[Christoph Putz]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/christophputz/2010/10/06/recursive-delete-procedure/</guid>
      <description><![CDATA[The following procedure can be used in development systems to remove data from tables which are...]]></description>
      <content:encoded><![CDATA[<p>The following procedure can be used in development systems to remove data from tables which are referenced by other tables. The procedure recursively follows all the references and deletes all referening tables first.</p>
<p>Be careful, when you use it! All data of all referenced tables will be deleted.</p>
<p><span style="font-size: small;">create procedure temp.</span><span style="font-size: small;">RecursiveDelete<br /></span><span style="font-size: small;">(<br />&nbsp;&nbsp;&nbsp;&nbsp; @tablename nvarchar(1000</span><span style="font-size: small;">)<br />&nbsp;&nbsp;&nbsp;&nbsp; ,@schemaname nvarchar(1000)</span><span style="font-size: small;">)<br /></span><span style="font-size: small;">as<br /><br />declare @oid as </span><span style="font-size: small;">int <br />declare @parentSchemaName as varchar(max</span><span style="font-size: small;">)<br />declare @parentObjectName as varchar(max</span><span style="font-size: small;">)<br /><br />select @oid = t.object_id from sys.tables&nbsp;t join sys.schemas&nbsp;s on t.schema_id = s.schema_id where t.name =</span><span style="font-size: small;"> @tablename<br />and s.name =</span><span style="font-size: small;"> @schemaname<br /><br />declare @parentOid </span><span style="font-size: small;">int<br /></span><span style="font-size: x-small; color: #0000ff;"><span style="font-size: x-small; color: #0000ff;"><br /><span style="font-size: small;">declare</span></span></span><span style="font-size: small;"> fkCursor cursor LOCAL for select parent_object_id, OBJECT_NAME(parent_object_id) from sys.foreign_keys where referenced_object_id = </span><span style="font-size: small;">@oid<br /><br />open</span><span style="font-size: small;"> fkCursor<br /><br />fetch next from fkCursor into @parentOid,</span><span style="font-size: small;"> @parentObjectName<br /><br />while @@FETCH_STATUS =</span><span style="font-size: small;"> 0<br /></span><span style="font-size: small;">Begin<br />&nbsp;&nbsp; select @parentSchemaName = s.name from sys.schemas s join sys.tables </span><span style="font-size: small;">t<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; on s.schema_id = t.</span><span style="font-size: x-small;"><span style="font-size: small;">schema_id<br />&nbsp;&nbsp; where t.object_id </span><a href="mailto:=@parentOid"><span style="font-size: small;">=</span></a><a href="mailto:=@parentOid"><span style="font-size: small;">@parentOid</span></a></span><span style="font-size: x-small; color: #0000ff;"><span style="font-size: x-small; color: #0000ff;"><br /><br /><span style="font-size: small;">&nbsp;&nbsp; exec</span></span></span><span style="font-size: small;"> temp.RecursiveDelete @parentObjectName</span><span style="font-size: small;">,<br /></span><span style="font-size: small;">&nbsp;&nbsp; @parentSchemaName<br /></span><span style="font-size: x-small; color: #0000ff;"><span style="font-size: x-small; color: #0000ff;"><br /><span style="font-size: small;">&nbsp;&nbsp; fetch</span></span></span><span style="font-size: small;"> next from fkCursor into @parentOid, </span><span style="font-size: small;">@parentObjectName<br /></span><span style="font-size: small;">End<br /><br /></span><span style="font-size: small;">-- delete data<br />declare @delStmt nvarchar(max</span><span style="font-size: small;">)<br /><br />set @delStmt = 'delete from [' + @schemaname + '].[' + @tablename + </span><span style="font-size: small;">']'<br /><br />exec sp_executesql </span><span style="font-size: small;">@delStmt<br /></span><span style="font-size: x-small; color: #0000ff;"><span style="font-size: x-small; color: #0000ff;"><br /><span style="font-size: small;">close </span></span></span><span style="font-size: small;">fkCursor<br />deallocate </span><span style="font-size: x-small;"><span style="font-size: small;">fkCursor<br /><br /></span>
<p><span style="font-size: x-small;"><span style="font-size: small;">g</span>o</span></p>
</span></p>]]></content:encoded>
    </item>
    <item>
      <title>Programmatically add or modify a FlatFile-Source component</title>
      <link>https://docs.microsoft.com/archive/blogs/christophputz/programmatically-add-or-modify-a-flatfile-source-component</link>
      <pubDate>Mon, 05 Jul 2010 23:36:00 GMT</pubDate>
      <dc:creator><![CDATA[Christoph Putz]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/christophputz/2010/07/05/programmatically-add-or-modify-a-flatfile-source-component/</guid>
      <description><![CDATA[Intro
&nbsp;
In the first article of this series I painted the high level picture and provided an...]]></description>
      <content:encoded><![CDATA[<h1 style="margin: 24pt 0cm 0pt;"><span lang="EN-US" style="mso-ansi-language: EN-US;"><span style="color: #365f91;"><span style="font-family: Arial Black;">Intro<o:p></o:p></span></span></span></h1>
<p class="MsoNormal" style="margin: 0cm 0cm 10pt;"><span lang="EN-US" style="mso-ansi-language: EN-US;"><o:p><span style="font-family: Calibri; font-size: small;">&nbsp;</span></o:p></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 10pt;"><span lang="EN-US" style="line-height: 115%; font-family: 'Arial','sans-serif'; font-size: 10pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-fareast-language: DE-AT;">In the first article of this series I painted the high level picture and provided an overview of the package generation framework. In this and the following articles I want to show how to programmatically generate or modify specific SSIS components.</span><span lang="EN-US" style="mso-ansi-language: EN-US;"><o:p></o:p></span></p>
<h2 style="margin: 10pt 0cm 0pt;"><span lang="EN-US" style="mso-ansi-language: EN-US;"><span style="font-size: medium;"><span style="color: #4f81bd;"><span style="font-family: Arial Black;">FlatFile Source Component<o:p></o:p></span></span></span></span></h2>
<p class="MsoNormal" style="margin: 0cm 0cm 10pt;"><span lang="EN-US" style="mso-ansi-language: EN-US;"><span style="font-size: small;"><span style="font-family: Calibri;">The first step is to find the connection manager component to modify or to add a new connection manager to the package.<o:p></o:p></span></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 10pt;"><span lang="EN-US" style="mso-ansi-language: EN-US;"><span style="font-family: Calibri; font-size: small;">All package connection managers can be found in the Connections collection of the </span></span><span lang="EN-US" style="line-height: 115%; font-family: 'Courier New'; font-size: 10pt; mso-ansi-language: EN-US; mso-no-proof: yes;">Microsoft.SqlServer.Dts.Runtime.<span style="color: #2b91af;">Package</span></span><span lang="EN-US" style="mso-ansi-language: EN-US;"><span style="font-size: small;"><span style="font-family: Calibri;"> class.<o:p></o:p></span></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 10pt;"><span lang="EN-US" style="mso-ansi-language: EN-US;"><span style="font-size: small;"><span style="font-family: Calibri;">So the first thing to do is to find the Connection Manager you want to edit. <o:p></o:p></span></span></span></p>
<p class="MsoNormal" style="line-height: normal; text-indent: 35.4pt; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span lang="EN-US" style="font-family: 'Courier New'; color: blue; font-size: 8pt; mso-ansi-language: EN-US; mso-no-proof: yes;">foreach</span><span lang="EN-US" style="font-family: 'Courier New'; font-size: 8pt; mso-ansi-language: EN-US; mso-no-proof: yes;"> (<span style="color: #2b91af;">ConnectionManager</span> connectionManager <span style="color: blue;">in</span> _Package.Connections)<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span lang="EN-US" style="font-family: 'Courier New'; font-size: 8pt; mso-ansi-language: EN-US; mso-no-proof: yes;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>{<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span lang="EN-US" style="font-family: 'Courier New'; font-size: 8pt; mso-ansi-language: EN-US; mso-no-proof: yes;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: blue;">if</span> (connectionManager.Name.Equals(<span style="color: #a31515;">"SourceFlatFileCM"</span>))<o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 10pt;"><span lang="EN-US" style="line-height: 115%; font-family: 'Courier New'; font-size: 8pt; mso-ansi-language: EN-US; mso-no-proof: yes;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>{<br /><span style="mso-tab-count: 2;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="mso-tab-count: 1;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>&hellip;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 10pt;"><span lang="EN-US" style="mso-ansi-language: EN-US;"><span style="font-size: small;"><span style="font-family: Calibri;">In the case that you want to add a Connection Manager programmatically versus editing an existing one you can use the following code.<o:p></o:p></span></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 10pt 35.4pt;"><span lang="EN-US" style="line-height: 115%; font-family: 'Courier New'; color: #2b91af; font-size: 8pt; mso-ansi-language: EN-US; mso-no-proof: yes;">ConnectionManager</span><span lang="EN-US" style="line-height: 115%; font-family: 'Courier New'; font-size: 8pt; mso-ansi-language: EN-US; mso-no-proof: yes;"> conManager = _Package.Connections.Add(<span style="color: #a31515;">"FLATFILE"</span>);<br /><span style="color: #2b91af;">IDTSConnectionManagerFlatFile100</span> connectionFlatFile = (<span style="color: #2b91af;">IDTSConnectionManagerFlatFile100</span>)conManager.InnerObject;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 10pt;"><span lang="EN-US" style="mso-ansi-language: EN-US;"><span style="font-size: small;"><span style="font-family: Calibri;">A list with all the viable parameters for the Add procedure can be found on this page: http://msdn.microsoft.com/en-us/library/ms136093.aspx<o:p></o:p></span></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 10pt;"><span lang="EN-US" style="mso-ansi-language: EN-US;"><span style="font-size: small;"><span style="font-family: Calibri;">Setting the necessary configurations on the Connection Manager is the next step. There are some generally valid properties and a lot of Connection Manager specific properties. The general properties are members of Connection Manger class whilst the specific properties can be set by acquiring an actual instance of the specific Connection Manager object (oleDbConnectionManager in the above example).<o:p></o:p></span></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 10pt;"><span lang="EN-US" style="mso-ansi-language: EN-US;"><span style="font-size: small;"><span style="font-family: Calibri;">In my simple example I set some hardcoded properties just do demonstrate the use of the Connection Manager.<o:p></o:p></span></span></span></p>
<p class="MsoNormal" style="line-height: normal; text-indent: 35.4pt; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span lang="EN-US" style="font-family: 'Courier New'; font-size: 8pt; mso-ansi-language: EN-US; mso-no-proof: yes;">connectionManager.Name = <span style="color: #a31515;">"SourceFlatFileCM"</span>;<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; text-indent: 35.4pt; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span lang="EN-US" style="font-family: 'Courier New'; font-size: 8pt; mso-ansi-language: EN-US; mso-no-proof: yes;">connectionManager.ConnectionString = <span style="color: #a31515;">"C:\Data\TestData.CSV";</span><span style="color: green;"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span lang="EN-US" style="font-family: 'Courier New'; font-size: 8pt; mso-ansi-language: EN-US; mso-no-proof: yes;"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span lang="EN-US" style="font-family: 'Courier New'; font-size: 8pt; mso-ansi-language: EN-US; mso-no-proof: yes;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="mso-tab-count: 1;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #2b91af;">IDTSConnectionManagerFlatFile100</span> connectionFlatFile<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span lang="EN-US" style="font-family: 'Courier New'; font-size: 8pt; mso-ansi-language: EN-US; mso-no-proof: yes;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>= (<span style="color: #2b91af;">IDTSConnectionManagerFlatFile100</span>)connectionManager.InnerObject;<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span lang="EN-US" style="font-family: 'Courier New'; font-size: 8pt; mso-ansi-language: EN-US; mso-no-proof: yes;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="mso-tab-count: 1;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>connectionFlatFile.RowDelimiter = <span style="color: #a31515;">"\n"</span>;<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span lang="EN-US" style="font-family: 'Courier New'; font-size: 8pt; mso-ansi-language: EN-US; mso-no-proof: yes;"><span style="mso-spacerun: yes;">&nbsp;</span><span style="mso-tab-count: 1;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>connectionFlatFile.Format = <span style="color: #a31515;">"Delimited"</span>;<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; text-indent: 35.4pt; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span lang="EN-US" style="font-family: 'Courier New'; font-size: 8pt; mso-ansi-language: EN-US; mso-no-proof: yes;">connectionFlatFile.ColumnNamesInFirstDataRow = <span style="color: blue;">true</span>;<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span lang="EN-US" style="font-family: 'Courier New'; font-size: 8pt; mso-ansi-language: EN-US; mso-no-proof: yes;"><span style="mso-tab-count: 1;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>connectionFlatFile.LocaleID = 1033;<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span lang="EN-US" style="font-family: 'Courier New'; font-size: 8pt; mso-ansi-language: EN-US; mso-no-proof: yes;"><span style="mso-tab-count: 1;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>connectionFlatFile.CodePage = 1252;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 10pt;"><span lang="EN-US" style="line-height: 115%; font-family: 'Courier New'; font-size: 8pt; mso-ansi-language: EN-US; mso-no-proof: yes;"><span style="mso-tab-count: 1;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>connectionFlatFile.RowDelimiter = <span style="color: #a31515;">"\n"</span>;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 10pt;"><span lang="EN-US" style="mso-ansi-language: EN-US;"><span style="font-size: small;"><span style="font-family: Calibri;">The next step is just needed if you are modifying an existing package and you want set up the column definition from scratch.<o:p></o:p></span></span></span></p>
<p class="MsoNormal" style="line-height: normal; text-indent: 35.4pt; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span lang="EN-US" style="font-family: 'Courier New'; color: green; font-size: 9pt; mso-ansi-language: EN-US; mso-no-proof: yes;">// remove existing columns<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span lang="EN-US" style="font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN-US; mso-no-proof: yes;"><span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: blue;">foreach</span> (<span style="color: #2b91af;">IDTSConnectionManagerFlatFileColumn100</span> column <span style="color: blue;">in</span> connectionFlatFile.Columns)<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; text-indent: 35.4pt; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span lang="EN-US" style="font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN-US; mso-no-proof: yes;">{<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; text-indent: 35.4pt; margin: 0cm 0cm 0pt 35.4pt; mso-layout-grid-align: none;"><span lang="EN-US" style="font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN-US; mso-no-proof: yes;">connectionFlatFile.Columns.Remove(column);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent: 35.4pt; margin: 0cm 0cm 10pt;"><span lang="EN-US" style="line-height: 115%; font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN-US; mso-no-proof: yes;">}<o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 10pt;"><span lang="EN-US" style="mso-ansi-language: EN-US;"><span style="font-size: small;"><span style="font-family: Calibri;">The final step is to add the column definitions to the Connection Managers Columns collection.<o:p></o:p></span></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 10pt;"><span lang="EN-US" style="mso-ansi-language: EN-US;"><span style="font-size: small;"><span style="font-family: Calibri;">The demo code shows how to add a FlatFileColumn to the collection.<o:p></o:p></span></span></span></p>
<p class="MsoNormal" style="line-height: normal; text-indent: 35.4pt; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span lang="EN-US" style="font-family: 'Courier New'; color: #2b91af; font-size: 8pt; mso-ansi-language: EN-US; mso-no-proof: yes;">IDTSConnectionManagerFlatFileColumn100</span><span lang="EN-US" style="font-family: 'Courier New'; font-size: 8pt; mso-ansi-language: EN-US; mso-no-proof: yes;"> flatFileColumn<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt 35.4pt; mso-layout-grid-align: none;"><span lang="EN-US" style="font-family: 'Courier New'; font-size: 8pt; mso-ansi-language: EN-US; mso-no-proof: yes;">= (<span style="color: #2b91af;">IDTSConnectionManagerFlatFileColumn100</span>)connectionFlatFile.Columns.Add();<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; text-indent: 35.4pt; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span lang="EN-US" style="font-family: 'Courier New'; font-size: 8pt; mso-ansi-language: EN-US; mso-no-proof: yes;">flatFileColumn.ColumnType = <span style="color: #a31515;">"Delimited"</span>;<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; text-indent: 35.4pt; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span lang="EN-US" style="font-family: 'Courier New'; font-size: 8pt; mso-ansi-language: EN-US; mso-no-proof: yes;">flatFileColumn.ColumnWidth = 0;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent: 35.4pt; margin: 0cm 0cm 10pt;"><span lang="EN-US" style="line-height: 115%; font-family: 'Courier New'; font-size: 8pt; mso-ansi-language: EN-US; mso-no-proof: yes;">flatFileColumn.MaximumWidth = 100;<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; text-indent: 35.4pt; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span lang="EN-US" style="font-family: 'Courier New'; font-size: 8pt; mso-ansi-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes;">flatFileColumn.DataPrecision = 0;<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; text-indent: 35.4pt; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span lang="EN-US" style="font-family: 'Courier New'; font-size: 8pt; mso-ansi-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes;">flatFileColumn.DataScale = 0;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent: 35.4pt; margin: 0cm 0cm 10pt;"><span lang="EN-US" style="line-height: 115%; font-family: 'Courier New'; font-size: 8pt; mso-ansi-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes;">flatFileColumn.TextQualified = <span style="color: blue;">false</span>;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 10pt 35.4pt;"><span lang="EN-US" style="line-height: 115%; font-family: 'Courier New'; color: #2b91af; font-size: 8pt; mso-ansi-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes;">IDTSName100</span><span lang="EN-US" style="line-height: 115%; font-family: 'Courier New'; font-size: 8pt; mso-ansi-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes;"> columnName = (<span style="color: #2b91af;">IDTSName100</span>) flatFileColumn;<br />columnName.Name = </span><span lang="EN-US" style="line-height: 115%; font-family: 'Courier New'; color: #a31515; font-size: 8pt; mso-ansi-language: EN-US; mso-no-proof: yes;">"CustomerName"</span><span lang="EN-US" style="line-height: 115%; font-family: 'Courier New'; font-size: 8pt; mso-ansi-language: EN-US; mso-no-proof: yes;">;<br /></span><span lang="EN-US" style="line-height: 115%; font-family: 'Courier New'; font-size: 8pt; mso-ansi-language: EN-US; mso-bidi-font-size: 10.0pt; mso-no-proof: yes;"><br />flatFileColumn.ColumnDelimiter = <span style="color: #a31515;">"\n"</span>; <span style="color: green;">// for the last column in the row</span></span><span lang="EN-US" style="line-height: 115%; font-family: 'Courier New'; font-size: 8pt; mso-ansi-language: EN-US; mso-no-proof: yes;"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 10pt;"><span lang="EN-US" style="mso-ansi-language: EN-US;"><span style="font-size: small;"><span style="font-family: Calibri;">In a real world example the above step will be done in a loop to add all the desired columns. An important point is to remember to set the ColumnDelimiter property of the last column of the row to the row delimiter. <o:p></o:p></span></span></span></p>]]></content:encoded>
    </item>
    <item>
      <title>Useful partition script</title>
      <link>https://docs.microsoft.com/archive/blogs/christophputz/useful-partition-script</link>
      <pubDate>Fri, 07 May 2010 13:35:00 GMT</pubDate>
      <dc:creator><![CDATA[Christoph Putz]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/christophputz/2010/05/07/useful-partition-script/</guid>
      <description><![CDATA[Retrieve filegroup by table name and partition range
The following script can be used to retrieve...]]></description>
      <content:encoded><![CDATA[<H2 style="MARGIN: 10pt 0cm 12pt"><SPAN style="mso-ansi-language: EN-US" lang=EN-US><FONT size=4><FONT color=#4f81bd><FONT face=Cambria>Retrieve filegroup by table name and partition range<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></FONT></FONT></FONT></SPAN></H2>
<P style="MARGIN: 0cm 0cm 6pt" class=MsoNormal><SPAN style="mso-ansi-language: EN-US" lang=EN-US><FONT size=3><FONT face=Calibri>The following script can be used to retrieve the filegroup name for a given table and a partition range.<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>It can be very useful in an automated sliding window process.<o:p></o:p></FONT></FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=Code><FONT face="Courier New"><SPAN style="COLOR: blue" lang=EN-US>declare</SPAN><SPAN lang=EN-US> @tablename <SPAN style="COLOR: blue">nvarchar</SPAN>(128)<o:p></o:p></SPAN></FONT></P>
<P style="MARGIN: 0cm 0cm 0pt" class=Code><FONT face="Courier New"><SPAN style="COLOR: blue" lang=EN-US>declare</SPAN><SPAN lang=EN-US> @range <SPAN style="COLOR: blue">sql_variant<o:p></o:p></SPAN></SPAN></FONT></P>
<P style="MARGIN: 0cm 0cm 0pt" class=Code><SPAN style="COLOR: blue" lang=EN-US><o:p><FONT face="Courier New">&nbsp;</FONT></o:p></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=Code><FONT face="Courier New"><SPAN style="COLOR: blue" lang=EN-US>set </SPAN><SPAN lang=EN-US>@tablename<SPAN style="COLOR: blue"> = ‚myPartitionedTable‘<o:p></o:p></SPAN></SPAN></FONT></P>
<P style="MARGIN: 0cm 0cm 0pt" class=Code><FONT face="Courier New"><SPAN style="COLOR: blue" lang=EN-US>set </SPAN><SPAN lang=EN-US>@range<SPAN style="COLOR: blue"> = 1209<o:p></o:p></SPAN></SPAN></FONT></P>
<P style="MARGIN: 0cm 0cm 0pt" class=Code><SPAN lang=EN-US><o:p><FONT face="Courier New">&nbsp;</FONT></o:p></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=Code><FONT face="Courier New"><SPAN style="COLOR: blue" lang=EN-US>declare</SPAN><SPAN lang=EN-US> @tableId <SPAN style="COLOR: blue">int<o:p></o:p></SPAN></SPAN></FONT></P>
<P style="MARGIN: 0cm 0cm 0pt" class=Code><FONT face="Courier New"><SPAN style="COLOR: blue" lang=EN-US>declare</SPAN><SPAN lang=EN-US> @FGName <SPAN style="COLOR: blue">nvarchar</SPAN><SPAN style="COLOR: gray">(</SPAN>128<SPAN style="COLOR: gray">)</SPAN><SPAN style="COLOR: blue"><o:p></o:p></SPAN></SPAN></FONT></P>
<P style="MARGIN: 0cm 0cm 0pt" class=Code><SPAN style="COLOR: gray" lang=EN-US><o:p><FONT face="Courier New">&nbsp;</FONT></o:p></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=Code><FONT face="Courier New"><SPAN style="COLOR: blue" lang=EN-US>set</SPAN><SPAN lang=EN-US> @tableId <SPAN style="COLOR: gray">=</SPAN> <SPAN style="COLOR: fuchsia">object_id</SPAN><SPAN style="COLOR: gray">(</SPAN>@tablename<SPAN style="COLOR: gray">)<o:p></o:p></SPAN></SPAN></FONT></P>
<P style="MARGIN: 0cm 0cm 0pt" class=Code><FONT face="Courier New"><SPAN style="COLOR: blue" lang=EN-US>select</SPAN><SPAN lang=EN-US> <o:p></o:p></SPAN></FONT></P>
<P style="MARGIN: 0cm 0cm 0pt" class=Code><SPAN lang=EN-US><o:p><FONT face="Courier New">&nbsp;</FONT></o:p></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=Code><SPAN lang=EN-US><FONT face="Courier New">@FGName <SPAN style="COLOR: gray">=</SPAN> main<SPAN style="COLOR: gray">.</SPAN>name <o:p></o:p></FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=Code><FONT face="Courier New"><SPAN style="COLOR: blue" lang=EN-US>from</SPAN><SPAN lang=EN-US> <o:p></o:p></SPAN></FONT></P>
<P style="MARGIN: 0cm 0cm 0pt" class=Code><FONT face="Courier New"><SPAN style="COLOR: blue" lang=EN-US><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN><SPAN style="COLOR: gray" lang=EN-US>(<o:p></o:p></SPAN></FONT></P>
<P style="MARGIN: 0cm 0cm 0pt" class=Code><SPAN lang=EN-US><FONT face="Courier New"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">select</SPAN> <o:p></o:p></FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=Code><SPAN lang=EN-US><FONT face="Courier New"><SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>a<SPAN style="COLOR: gray">.</SPAN>partition_number<SPAN style="COLOR: gray">,<o:p></o:p></SPAN></FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=Code><SPAN lang=EN-US><FONT face="Courier New"><SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>c<SPAN style="COLOR: gray">.</SPAN>name<SPAN style="COLOR: gray">,<o:p></o:p></SPAN></FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=Code><SPAN lang=EN-US><FONT face="Courier New"><SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>e<SPAN style="COLOR: gray">.</SPAN>function_id<o:p></o:p></FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=Code><SPAN lang=EN-US><FONT face="Courier New"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">from</SPAN> <o:p></o:p></FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=Code><SPAN lang=EN-US><FONT face="Courier New"><SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: green">sys</SPAN><SPAN style="COLOR: gray">.</SPAN><SPAN style="COLOR: green">partitions</SPAN> a <o:p></o:p></FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=Code><SPAN lang=EN-US><FONT face="Courier New"><SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: gray">inner</SPAN> <SPAN style="COLOR: gray">join</SPAN> <SPAN style="COLOR: green">sys</SPAN><SPAN style="COLOR: gray">.</SPAN><SPAN style="COLOR: green">allocation_units</SPAN> b <o:p></o:p></FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=Code><SPAN lang=EN-US><FONT face="Courier New"><SPAN style="mso-tab-count: 4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">on</SPAN> a<SPAN style="COLOR: gray">.</SPAN>hobt_id <SPAN style="COLOR: gray">=</SPAN> b<SPAN style="COLOR: gray">.</SPAN>container_id<o:p></o:p></FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=Code><SPAN lang=EN-US><FONT face="Courier New"><SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: gray">inner</SPAN> <SPAN style="COLOR: gray">join</SPAN> <SPAN style="COLOR: green">sys</SPAN><SPAN style="COLOR: gray">.</SPAN><SPAN style="COLOR: green">data_spaces</SPAN> c <o:p></o:p></FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=Code><SPAN lang=EN-US><FONT face="Courier New"><SPAN style="mso-tab-count: 4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">on</SPAN> b<SPAN style="COLOR: gray">.</SPAN>data_space_id <SPAN style="COLOR: gray">=</SPAN> c<SPAN style="COLOR: gray">.</SPAN>data_space_id<o:p></o:p></FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=Code><SPAN lang=EN-US><FONT face="Courier New"><SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: gray">inner</SPAN> <SPAN style="COLOR: gray">join</SPAN> <SPAN style="COLOR: green">sys</SPAN><SPAN style="COLOR: gray">.</SPAN><SPAN style="COLOR: green">destination_data_spaces</SPAN> d <o:p></o:p></FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=Code><SPAN lang=EN-US><FONT face="Courier New"><SPAN style="mso-tab-count: 4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">on</SPAN> c<SPAN style="COLOR: gray">.</SPAN>data_space_id <SPAN style="COLOR: gray">=</SPAN> d<SPAN style="COLOR: gray">.</SPAN>data_space_id<o:p></o:p></FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=Code><FONT face="Courier New"><SPAN lang=EN-US><SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN><SPAN style="COLOR: gray; mso-ansi-language: DE-AT">inner</SPAN><SPAN style="mso-ansi-language: DE-AT"> <SPAN style="COLOR: gray">join</SPAN> <SPAN style="COLOR: green">sys</SPAN><SPAN style="COLOR: gray">.</SPAN><SPAN style="COLOR: green">partition_schemes</SPAN> e <o:p></o:p></SPAN></FONT></P>
<P style="MARGIN: 0cm 0cm 0pt" class=Code><FONT face="Courier New"><SPAN style="mso-ansi-language: DE-AT"><SPAN style="mso-tab-count: 4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN><SPAN style="COLOR: blue" lang=EN-US>on</SPAN><SPAN lang=EN-US> d<SPAN style="COLOR: gray">.</SPAN>partition_scheme_id <SPAN style="COLOR: gray">=</SPAN> e<SPAN style="COLOR: gray">.</SPAN>data_space_id<o:p></o:p></SPAN></FONT></P>
<P style="MARGIN: 0cm 0cm 0pt" class=Code><SPAN lang=EN-US><FONT face="Courier New"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">where</SPAN> a<SPAN style="COLOR: gray">.</SPAN><SPAN style="COLOR: fuchsia">object_id</SPAN> <SPAN style="COLOR: gray">=</SPAN> @tableId<o:p></o:p></FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=Code><SPAN lang=EN-US><FONT face="Courier New"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: gray">)</SPAN> main<o:p></o:p></FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=Code><SPAN lang=EN-US><FONT face="Courier New"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: gray">inner</SPAN> <SPAN style="COLOR: gray">join</SPAN> <o:p></o:p></FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=Code><FONT face="Courier New"><SPAN style="COLOR: blue" lang=EN-US><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN><SPAN style="COLOR: gray" lang=EN-US>(<o:p></o:p></SPAN></FONT></P>
<P style="MARGIN: 0cm 0cm 0pt" class=Code><SPAN lang=EN-US><FONT face="Courier New"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">select</SPAN> <o:p></o:p></FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=Code><SPAN lang=EN-US><FONT face="Courier New"><SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>a<SPAN style="COLOR: gray">.</SPAN>function_id<SPAN style="COLOR: gray">,</SPAN> <o:p></o:p></FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=Code><SPAN lang=EN-US><FONT face="Courier New"><SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>b<SPAN style="COLOR: gray">.</SPAN>value<SPAN style="COLOR: gray">,<o:p></o:p></SPAN></FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=Code><SPAN lang=EN-US><FONT face="Courier New"><SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">case</SPAN> <SPAN style="COLOR: blue">when</SPAN> a<SPAN style="COLOR: gray">.</SPAN>boundary_value_on_right <SPAN style="COLOR: gray">=</SPAN> 0 <SPAN style="COLOR: blue">then</SPAN> b<SPAN style="COLOR: gray">.</SPAN>boundary_id <SPAN style="COLOR: blue">else</SPAN> b<SPAN style="COLOR: gray">.</SPAN>boundary_id <SPAN style="COLOR: gray">+</SPAN> 1 <SPAN style="COLOR: blue">end</SPAN> partition_id<o:p></o:p></FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=Code><SPAN lang=EN-US><FONT face="Courier New"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">from</SPAN> <o:p></o:p></FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=Code><SPAN lang=EN-US><FONT face="Courier New"><SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: green">sys</SPAN><SPAN style="COLOR: gray">.</SPAN><SPAN style="COLOR: green">partition_functions</SPAN> a <o:p></o:p></FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=Code><SPAN lang=EN-US><FONT face="Courier New"><SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: gray">inner</SPAN> <SPAN style="COLOR: gray">join</SPAN> <SPAN style="COLOR: green">sys</SPAN><SPAN style="COLOR: gray">.</SPAN><SPAN style="COLOR: green">partition_range_values</SPAN> b <o:p></o:p></FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=Code><SPAN lang=EN-US><FONT face="Courier New"><SPAN style="mso-tab-count: 4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">on</SPAN> a<SPAN style="COLOR: gray">.</SPAN>function_id <SPAN style="COLOR: gray">=</SPAN> b<SPAN style="COLOR: gray">.</SPAN>function_id<o:p></o:p></FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=Code><SPAN lang=EN-US><FONT face="Courier New"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">where<o:p></o:p></SPAN></FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=Code><SPAN lang=EN-US><FONT face="Courier New"><SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>b<SPAN style="COLOR: gray">.</SPAN>value <SPAN style="COLOR: gray">=</SPAN> @range<o:p></o:p></FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=Code><SPAN lang=EN-US><FONT face="Courier New"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: gray">)</SPAN> part <o:p></o:p></FONT></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=Code><FONT face="Courier New"><SPAN style="COLOR: blue" lang=EN-US>on</SPAN><SPAN lang=EN-US> main<SPAN style="COLOR: gray">.</SPAN>function_id <SPAN style="COLOR: gray">=</SPAN> part<SPAN style="COLOR: gray">.</SPAN>function_id <SPAN style="COLOR: gray">and</SPAN> main<SPAN style="COLOR: gray">.</SPAN>partition_number <SPAN style="COLOR: gray">=</SPAN> part<SPAN style="COLOR: gray">.</SPAN>partition_id<o:p></o:p></SPAN></FONT></P>
<P style="MARGIN: 0cm 0cm 6pt" class=MsoNormal><SPAN style="mso-ansi-language: EN-US" lang=EN-US><o:p><FONT size=3 face=Calibri>&nbsp;</FONT></o:p></SPAN></P>]]></content:encoded>
    </item>
  </channel>
</rss>