Create and Load a Cache transform



This snipped shows how to create and load a persistent lookup Cache. The cache is written to a cache file.

published 04.13.15

last updated 04.13.15



  • Cache
  • Transform

<Biml xmlns="">
          <RawFileFormat Name="CacheFormat">
                    <Column Name="CustomerKey" DataType="Int32" IndexPosition="0"></Column>
                    <Column Name="CustomerAlternateKey" DataType="String" Length="15" IndexPosition="1"></Column>
          <FileConnection Name="LookupCacheFile" CreateInProject="1" FilePath="C:\CustomerLookupCache.CAW"></FileConnection>
          <CacheConnection Name="LookupCache" CreateInProject="1" RawFileFormatName="CacheFormat" PersistFileConnectionName="LookupCacheFile"></CacheConnection>
          <Connection Name="AdventureWorksDW2014" CreateInProject="1" ConnectionString="Data Source=MyServer\SANDBOX;Initial Catalog=AdventureWorksDW2014;Provider=SQLOLEDB.1;Integrated Security=SSPI;"></Connection>
          <Package Name ="TestCacheTransform" ConstraintMode="Linear">
                    <Dataflow Name ="LoadCacheTransform">
                              <OleDbSource Name ="Read Customer" ConnectionName="AdventureWorksDW2014">
                                   <DirectInput>SELECT  CustomerKey, CustomerAlternateKey FROM DimCustomer</DirectInput>
                              <Cache Name="Customer Cache" ConnectionName="LookupCache">
                                   <InputPath OutputPathName="Read Customer.Output"></InputPath>


First a new RawfileFormat is created. This describes the format of the Cache file Secondly two connections are created: - File connection which points to the location of the Cache file. If you are creating an In-Memory cache, this is not needed. - Cache connection. The cache connection points to both the RawfileFormat and the File connection. If you are using an In-Memory cache leave the "PersistFileConnectionName="LookupCacheFile"" out

The Package contains a dataflow to retrieve data from a source (in this case the DimCustomer table in the Adventureworks sample database) The source is written to the Cache transform. Because the Cache uses the same column names as the source, no column mappings are needed.

You are not authorized to comment. A verification email has been sent to your email address. Please verify your account.


There are no comments yet.