Need code to generate and SSIS Package with BIML containing a COZYROC Table Difference component - ssis

Can anyone please help with a code sample showing how to generate an SSIS package using BIML that contains a COZYROC Table Difference Component?
I found a piece of sample code on BimlScript.com that looks like the code you would expect to see up to the COZYROC Table Difference component but does not actually contain the Table Difference part. https://www.bimlscript.com/Snippet/Details/63
Here is the code I used for the table diff component:
<CustomComponent Name="TableDiff" ComponentTypeName="CozyRoc.SqlServer.SSIS.TableDifference, CozyRoc.SSISPlus.2019, Version=1.0.0.0, Culture=neutral, PublicKeyToken=16cf490bb80c34ea" Version="3">
<CustomProperties>
<CustomProperty Name="NewInputLineageIDs" DataType="Int32" IsArray="true" TypeConverter="" UITypeEditor="" ContainsId="true"></CustomProperty>
<CustomProperty Name="OldInputLineageIDs" DataType="Int32" IsArray="true" TypeConverter="" UITypeEditor="" ContainsId="true"></CustomProperty>
<CustomProperty Name="KeyOrders" DataType="Int32" IsArray="true" TypeConverter="" UITypeEditor=""></CustomProperty>
<CustomProperty Name="UpdateIDs" DataType="Int32" IsArray="true" TypeConverter="" UITypeEditor=""></CustomProperty>
<CustomProperty Name="CheckOptions" DataType="Int32" IsArray="true" TypeConverter="" UITypeEditor=""></CustomProperty>
<CustomProperty Name="Names" DataType="String" IsArray="true" TypeConverter="" UITypeEditor=""></CustomProperty>
<CustomProperty Name="StringCompareCultureId" DataType="Int32" TypeConverter="" UITypeEditor="">0</CustomProperty>
<CustomProperty Name="StringCompareIgnoreCase" DataType="Boolean" TypeConverter="" UITypeEditor="">false</CustomProperty>
<CustomProperty Name="StringCompareIgnoreKana" DataType="Boolean" TypeConverter="" UITypeEditor="">false</CustomProperty>
<CustomProperty Name="StringCompareIgnoreWidth" DataType="Boolean" TypeConverter="" UITypeEditor="">false</CustomProperty>
<CustomProperty Name="StringCompareIgnoreNonSpace" DataType="Boolean" TypeConverter="" UITypeEditor="">false</CustomProperty>
<CustomProperty Name="StringCompareIgnoreSymbols" DataType="Boolean" TypeConverter="" UITypeEditor="">false</CustomProperty>
<CustomProperty Name="StringCompareSort" DataType="Boolean" TypeConverter="" UITypeEditor="">false</CustomProperty>
<CustomProperty Name="EnableLogOutput" DataType="Boolean" TypeConverter="NOTBROWSABLE" UITypeEditor="">false</CustomProperty>
<CustomProperty Name="IncludeInputColumnsInLogOutput" DataType="Boolean" TypeConverter="" UITypeEditor="">true</CustomProperty>
</CustomProperties>
<Annotations>
<Annotation AnnotationType="Description">Find the difference between two data flows."</Annotation>
</Annotations>
<InputPaths>
<InputPath OutputPathName="MuilticastLeft.Output1" SsisName="New Data Flow" Identifier="NEW"></InputPath>
<InputPath OutputPathName="MuilticastRight.Output1" SsisName="Old Data Flow" Identifier="OLD"></InputPath>
</InputPaths>

BimlExpress allows you to reverse engineer an existing SSIS package to Biml. Since I don't have the cozyroc componentry installed on my machine, I can take a guess based on the linked component but in general, this will be a CustomComponent with the CozyRoc specific bits filled in.
First will be the name of the assembly (guessed) along with the public key token. You can right click on the associated dll, select Properties and get this information from the Details tab.
<CustomComponent Name="Table Difference" ComponentTypeName="CozyRoc.SqlServer.SSIS.TableDifference, CozyRoc.SSISPlus.XXXX, Version=1.0.0.0, Culture=neutral, PublicKeyToken=XXXXXXXXXX" ContactInfo="">
<CustomProperties>
<CustomProperty Name="IgnoreCase" DataType="Boolean" TypeConverter="" UITypeEditor="">false</CustomProperty>
<!-- etc -->
</CustomProperties>
<InputPaths>
<InputPath OutputPathName="OLE DB Source.Output" SsisName="Input" ErrorOrTruncationOperation="" Identifier="Input" />
</InputPaths>
<OutputPaths>
<OutputPath Name="Output" ErrorOrTruncationOperation="" SynchronousInput="Input" />
</OutputPaths>
</CustomComponent>
Generally, I'd expect you'll be adding a CustomProperty for all the settings in the component. As you can see, the table difference is much more complex http://www.cozyroc.com/ssis/table-difference than the Flow Synchronization https://www.cozyroc.com/ssis/flow-synchronization with the many parameters vs 3.

Related

How can I configure a BIML element for attunity Oracle connector?

I read from Using the Attunity Oracle Connector with Biml a way to define an element for Attune Oracle connector by using CustomSsisConnection element . It's different from the actual connection definition in place in the project connection I have to work with. The current Attunity connector definition is defined by a DTS:ConnectionManager element, in which I change values to ###### for security reasons:
<DTS:ConnectionManager xmlns:DTS="www.microsoft.com/SqlServer/Dts"
DTS:ObjectName="Oracle_TVIA"
DTS:DTSID="{608D9C98-CC33-4EC7-BF35-DDDB7BDBDBC7}"
DTS:CreationName="MSORA">
<DTS:PropertyExpression
DTS:Name="ConnectionString">#[$Project::Oracle_Connector]
</DTS:PropertyExpression>
<DTS:ObjectData>
<OracleXMLPackage>
<OraConnectionString>SERVER=######;USERNAME=
######;ORACLEHOME=;ORACLEHOME64=;WINAUTH=0</OraConnectionString>
<OraRetain>False</OraRetain>
<OraInitialCatalog></OraInitialCatalog>
<OraServerName>######</OraServerName
<OraUserName>######</OraUserName>
<OraOracleHome></OraOracleHome>
<OraOracleHome64></OraOracleHome64>
<OraWinAuthentication>False</OraWinAuthentication>
<OraEnableDetailedTracing>False</OraEnableDetailedTracing>
<OraPassword
Sensitive="1"
p4:Salt="######"
p4:IV="######"
xmlns:p4="www.microsoft.com/SqlServer/SSIS">############</OraPassword>
</OracleXMLPackage>
</DTS:ObjectData>
</DTS:ConnectionManager>
Attunity's connection mentioned in post is:
<CustomSsisConnection Name="Oracle Connector 1" CreationName="MSORA" ObjectData="<OracleXMLPackage>
  <OraConnectionString>SERVER=XXXX;USERNAME=username;ORACLEHOME=;ORACLEHOME64=;WINAUTH=0</OraConnectionString>
  <OraRetain>False</OraRetain>
  <OraInitialCatalog></OraInitialCatalog>
  <OraServerName>ec2-107-20-117-195.compute-1.amazonaws.com</OraServerName>
  <OraUserName>username</OraUserName>
  <OraOracleHome></OraOracleHome>
  <OraOracleHome64></OraOracleHome64>
  <OraWinAuthentication>False</OraWinAuthentication>
  <OraEnableDetailedTracing>False</OraEnableDetailedTracing>
  <OraPassword Sensitive="1" Encrypted="1">AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAm1Wd3JvvU0+cUJlVQyqnaAAAAAAIAAAARABUAFMAAAADZgAAwAAAABAAAAA6xkf97NyWpMZVJk8BfUfOAAAAAASAAACgAAAAEAAAABcdn9bN864uL88pKlNCAlwYAAAAcbtMszBiQhegvc8dBJXJRRNt9xmQRe2pFAAAANMQTe7MVbECC97BJJ8QQO0KMUfc</OraPassword>
</OracleXMLPackage>" />
When I attemp to add this code within Biml schema, I got an compilation error message telling DTS:ConnectionManager is not a valid child of Biml.
Would you please advise how would I convert the DTS:ConnectionManager's definition to CustomSsisConnection's.
Thanks
The code generated by XSLT is :
<?xml version="1.0" encoding="utf-8"?>
<Biml xmlns="http://schemas.varigence.com/biml.xsd">
<Connections>
<Connection Name="Oracle_TVIA" ConnectionString="SERVER=######;USERNAME=######;ORACLEHOME=;ORACLEHOME64=;WINAUTH=0" />
<Connection Name="Target_SQLBIPRO" ConnectionString="Data Source=SQLBIDES;Initial Catalog=TVIA;Provider=SQLNCLI11.1;Integrated Security=SSPI;" />
</Connections>
<Packages>
<Package ConstraintMode="Linear" Name="staging_AMS_CD_PAYMENT_CATEGORY">
<Tasks>
<ExecuteSQL Name="Truncate_AMS_CD_PAYMENT_CATEGORY" ConnectionName="Target_SQLBIPRO">
<DirectInput>"exec dbo.delete_AMS_CD_PAYMENT_CATEGORY ?,?"</DirectInput>
</ExecuteSQL>
<Dataflow Name="Load_AMS_CD_PAYMENT_CATEGORY">
<PrecedenceConstraints>
<Inputs>
<Input OutputPathName="Truncate_AMS_CD_PAYMENT_CATEGORY.Output" />
</Inputs>
</PrecedenceConstraints>
<Transformations>
<OleDbSource Name="Source_AMS_CD_PAYMENT_CATEGORY" ConnectionName="Oracle_TVIA">
<ExternalTableInput Table="AMS_CD_PAYMENT_CATEGORY" />
</OleDbSource>
<OleDbDestination Name="Target_AMS_CD_PAYMENT_CATEGORY" ConnectionName="Target_SQLBIPRO">
<InputPath OutputPathName="Source_AMS_CD_PAYMENT_CATEGORY.Output" />
<ExternalTableOutput Table="Staging_BOS_VR_OWNER_AMS_CD_PAYMENT_CATEGORY" />
</OleDbDestination>
</Transformations>
</Dataflow>
</Tasks>
</Package>
</Package>
</Packages>
</Biml>

SSIS OnVariableValueChanged not fired

I am generating a SSIS dtsx using BIML.
I want every change of a value of any variable to be logged.
I have several variables, all with RaiseChangeEvent at TRUE.
I have a OnVariableValueChanged event handler set for the package and for the dataflow where the variables are changed (by a Count Row).
When I execute the dtsx I see the handler is not even called.
I tried with other events and they are called.
So what is preventing the OnVariableValueChanged to be handled?
All the variables will be set to 0 or positive values and I made sure they start with a value of -1 in order to be sure there will actually be a change of value.
This seems to work for me. I create a variable with RaiseChangedEvent set to true. I then have a For Loop increment that value. I have a script task inside the for loop logging the value and an Event Handler attached to the package for the OnVariableValueChanged event. There I have a sequence container and a script task (disabled). If I put a breakpoint on the container, I can see that it is being called. Enabling the script task there, despite being the same code as in the control flow, results in a timeout error for locking the variable. /shrug
<!-- http://stackoverflow.com/q/42945383/181965 -->
<Biml xmlns="http://schemas.varigence.com/biml.xsd">
<Packages>
<Package Name="so_42945383" >
<Variables>
<Variable DataType="Int32" Name="IndexCurrent" RaiseChangedEvent="true">-1</Variable>
<Variable DataType="Int32" Name="IndexStart">0</Variable>
<Variable DataType="Int32" Name="IndexStop">1</Variable>
</Variables>
<Tasks>
<ForLoop Name="FLT Modify values" ConstraintMode="Linear">
<InitializerExpression><![CDATA[#[User::IndexCurrent] = #[User::IndexStart]]]></InitializerExpression>
<LoopTestExpression><![CDATA[#[User::IndexCurrent] <= #[User::IndexStop]]]></LoopTestExpression>
<CountingExpression><![CDATA[#[User::IndexCurrent] = #[User::IndexCurrent] + 1]]></CountingExpression>
<Tasks>
<Container Name="SEQC Do nothing" />
<Script ProjectCoreName="FLT_ST_EchoBack" Name="SCR Echo Back FLT">
<ScriptTaskProjectReference ScriptTaskProjectName="ST_EchoBack" />
</Script>
</Tasks>
</ForLoop>
</Tasks>
<Events>
<Event Name="OVVC" EventType="OnVariableValueChanged">
<Tasks>
<Container Name="SEQC Do nothing" />
<Script ProjectCoreName="OVCC_ST_EchoBack" Name="SCR Echo Back OVVC" Disabled="true">
<ScriptTaskProjectReference ScriptTaskProjectName="ST_EchoBack" />
</Script>
</Tasks>
</Event>
</Events>
</Package>
</Packages>
<ScriptProjects>
<ScriptTaskProject ProjectCoreName="ST_EchoBack" Name="ST_EchoBack" VstaMajorVersion="0">
<ReadOnlyVariables>
<!-- List all the variables you are interested in tracking -->
<Variable Namespace="User" VariableName="IndexCurrent" DataType="Int32" />
<Variable Namespace="User" VariableName="IndexStart" DataType="Int32" />
<Variable Namespace="User" VariableName="IndexStop" DataType="Int32" />
</ReadOnlyVariables>
<Files>
<File Path="ScriptMain.cs" BuildAction="Compile">using System;
using System.Data;
using Microsoft.SqlServer.Dts.Runtime;
using System.Windows.Forms;
namespace ST_EchoBack
{
[Microsoft.SqlServer.Dts.Tasks.ScriptTask.SSISScriptTaskEntryPointAttribute]
public partial class ScriptMain : Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTARTScriptObjectModelBase
{
public void Main()
{
bool fireAgain = false;
string message = "{0}::{1} : {2}";
foreach (var item in Dts.Variables)
{
Dts.Events.FireInformation(0, "SCR Echo Back", string.Format(message, item.Namespace, item.Name, item.Value), string.Empty, 0, ref fireAgain);
}
Dts.TaskResult = (int)ScriptResults.Success;
}
enum ScriptResults
{
Success = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Success,
Failure = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure
};
}
} </File>
<File Path="Properties\AssemblyInfo.cs" BuildAction="Compile">
using System.Reflection;
using System.Runtime.CompilerServices;
[assembly: AssemblyVersion("1.0.*")]
</File>
</Files>
<AssemblyReferences>
<AssemblyReference AssemblyPath="System" />
<AssemblyReference AssemblyPath="System.Data" />
<AssemblyReference AssemblyPath="System.Windows.Forms" />
<AssemblyReference AssemblyPath="System.Xml" />
<AssemblyReference AssemblyPath="Microsoft.SqlServer.ManagedDTS.dll" />
<AssemblyReference AssemblyPath="Microsoft.SqlServer.ScriptTask.dll" />
</AssemblyReferences>
</ScriptTaskProject>
</ScriptProjects>
</Biml>

Biml Master-Child package connections

In a 2008 BIDS/SQL Server/SSIS dev environment (along with BIDS Helper v1.70), I'm trying to create a biml master package that executes the child packages already built under Rootnode. Also using a config file to be able to run the entire process on different servers.
Config File
?xml version="1.0"?>
<DTSConfiguration>
<DTSConfigurationHeading><DTSConfigurationFileInfo GeneratedBy="XXXXXX" GeneratedDate="7/28/2016 1:28:29 PM"/></DTSConfigurationHeading>
<Configuration ConfiguredType="Property" Path="\Package.Connections[dw].Properties[ConnectionString]" ValueType="String">
<ConfiguredValue>Data Source=imsqldv50s\euc;Initial Catalog=CDODW;Provider=SQLNCLI10.1;Integrated Security=SSPI;</ConfiguredValue>
</Configuration>
<Configuration ConfiguredType="Property" Path="\Package.Connections[PkgFile].Properties[ConnectionString]" ValueType="String">
<ConfiguredValue>\\IMSQLDV50s\EUCPACKAGES\CDODW\Load CDODW Tables Biml\</ConfiguredValue>
</Configuration>
<Configuration ConfiguredType="Property" Path="\Package.Variables[User::ChildPackagePath].Properties[Value]" ValueType="String">
<ConfiguredValue>\\IMSQLDV50s\EUCPACKAGES\CDODW\Load CDODW Tables Biml\</ConfiguredValue>
</Configuration>
</DTSConfiguration>
The building of the child packages has been tested and passed. Now we are attempting to build the Master Package.
05-load-edw-master.biml
<Biml xmlns="http://schemas.varigence.com/biml.xsd">
<Packages>
<Package Name ="Master EDW Load" ConstraintMode ="Linear">
<PackageConfigurations>
<PackageConfiguration Name="dw">
<ExternalFileInput ExternalFilePath="C:\SSISConfig\CDODW_ETL_Load.dtsConfig" />
<ConfigurationValues>
<ConfigurationValue DataType="String" Name="dw" PropertyPath="\Package.Connections[dw].Properties[ConnectionString]" Value=""></ConfigurationValue>
</ConfigurationValues>
</PackageConfiguration>
<PackageConfiguration Name="PkgFile">
<ExternalFileInput ExternalFilePath="C:\SSISConfig\CDODW_ETL_Load.dtsConfig" />
<ConfigurationValues>
<ConfigurationValue DataType="String" Name="PkgFile" PropertyPath="\Package.Connections[PkgFile].Properties[ConnectionString]" Value=""></ConfigurationValue>
</ConfigurationValues>
</PackageConfiguration>
</PackageConfigurations>
<#=CallBimlScript("cbs-pkg-params-variables.biml", "No Table", "master-load", "","","")#>
<!--
<Connections>
<Connection ConnectionName="dw" />
<Connection ConnectionName="PkgFile">
<Expressions>
<Expression PropertyName="PkgFile.ConnectionString">#[User::ChildPackagePath]</Expression>
</Expressions>
</Connection>
</Connections>
-->
<Tasks>
<#=CallBimlScript("cbs-sql-audit-begin.biml", "master-load")#>
<Container Name="SEQ Load Dimensions" ConstraintMode="Linear">
<Tasks>
<# foreach (var package in RootNode.Packages.Where(pkg => pkg.GetTag("type")=="load-edw-dim").OrderBy(pkg => pkg.GetTag("LoadOrder"))) { #>
<ExecutePackage Name="EP <#=package.Name#>" DelayValidation="true">
<Package PackageName="<#=package.Name #>" />
</ExecutePackage>
<# } #>
</Tasks>
</Container>
<Container Name="SEQ Load Facts" ConstraintMode="Linear">
<Tasks>
<# foreach (var package in RootNode.Packages.Where(pkg => pkg.GetTag("type")=="load-edw-fact").OrderBy(pkg => pkg.GetTag("LoadOrder"))) { #>
<ExecutePackage Name="EP <#=package.Name #>" DelayValidation="true">
<Package PackageName="<#=package.Name #>" />
</ExecutePackage>
<# } #>
</Tasks>
</Container>
<#=CallBimlScript("cbs-sql-audit-end.biml")#>
</Tasks>
<Annotations>
<Annotation AnnotationType="Tag" Tag="type">master-load</Annotation>
</Annotations>
</Package>
</Packages>
</Biml>
<## template language="C#" tier="5"#>
The Connections have already been defined in a tier 1 file
After generating the packages, I note that the Biml engine creates Connection Managers using a convention "_" + Master Package Name.SequenceContainerName.ExecutePackageName, with a connection string pointing to the local file path. And it's doing so "under the covers" as there is no clue in the expanded biml file of how it's done!
Is there a nice simple way to interject a passed-in file path from the config file that can be recognized and used to build each FileConnection's data? I thought it would make sense to store the relevant file location in a variable (fed from the config file) and somehow use that to develop the ConnectionString from the package name garnered from the foreach snippet, but the engine doesn't appear to like that.
Any help is appreciated.
Thanks!

SSIS BIML Derived Column syntax for expressions

I am defining a Derived Column transformation in BIML but I am having trouble referencing the output from the previous Excel Source in my Derived Column transformation.
I receive the error upon opening the package after successfully generating the SSIS package and it suggests that it the Derived Transformation cannot find the output from the Excel Source.
Error 2 Error loading AFR_ShareTableBIML.dtsx: The object
"/DTS:Executable/DTS:Executables/DTS:Executable/DTS:ObjectData/pipeline/components/component/inputs/input/inputColumns/inputColumn/properties/property"
references ID "#{Package\Data Flow {Import Share Table CSV}\Source
{Flat File Share Table}.Outputs[Output].Columns[Div c per share]}",
but no object in the package has this ID.
Here is a code snippet:
<Biml xmlns="http://schemas.varigence.com/biml.xsd">
<FileFormats>
<FlatFileFormat Name="FFF_AFRShareTable" ColumnNamesInFirstDataRow="true"
FlatFileType="Delimited" IsUnicode="false" TextQualifer="None" HeaderRowsToSkip="6">
<Columns>
<Column Name="Quote Buy" ColumnType="Delimited" DataType="AnsiString" Length ="50" Delimiter=","></Column>
<Column Name="Quote Sell" ColumnType="Delimited" DataType="AnsiString" Length ="50" Delimiter=","></Column>
<Column Name="Div c per share" ColumnType="Delimited" DataType="AnsiString" Length ="50" Delimiter=","></Column>
</Columns>
</FlatFileFormat>
</FileFormats>
<Connections>
<FlatFileConnection Name="FF_AFRShareTable" FileFormat="FFF_AFRShareTable"
FilePath="C:\Temp\Stocks.csv"></FlatFileConnection>
<OleDbConnection Name="CMD DB"
ConnectionString="Data Source=Localhost;Initial Catalog=DB;Provider=SQLNCLI11.1;Integrated Security=SSPI;" CreateInProject="true">
</OleDbConnection>
</Connections>
<Packages>
<Package Name="AFR_ShareTableBIML" ConstraintMode="Linear" ProtectionLevel="DontSaveSensitive">
<Tasks>
<ExecuteSQL Name="SQLTask {OLE_DB} Truncate Security Share Table" ConnectionName="CMD DB">
<DirectInput>truncate table Staging.SecurityShareTable</DirectInput>
</ExecuteSQL>
<Dataflow Name="Data Flow {Import Share Table CSV}">
<Transformations>
<FlatFileSource Name="Source {Flat File Share Table}" ConnectionName="FF_AFRShareTable"></FlatFileSource>
<DerivedColumns Name="DER_NullifyColumns">
<Columns>
<Column Name ="DER_DPS" DataType = "Decimal" Precision="4">
[Div c per share] == "-" ? NULL(DT_DECIMAL, 4) : (DT_DECIMAL, 4)[Div c per share]
</Column>
</Columns>
</DerivedColumns>
</Transformations>
</Dataflow>
</Tasks>
</Package>
</Packages>
I have already defined the column name via the FlatFileFormat and I have confirmed that the expression in the DER_DPS column is is syntactically correct. I found that through replacing the square brackets "[" and "]" with double apostrophes, the SSIS package can be opened. For example:
"Div c per share" == "-" ? NULL(DT_DECIMAL, 4) : (DT_DECIMAL, 4) "Div c per share"
However there are derived column transformation errors on incorrect syntax. Are square brackets special characters in BIML that I need to escape?
That was ... interesting.
It appears that your use of curly braces in your component names causes the Biml expansion to go haywire.
<Biml xmlns="http://schemas.varigence.com/biml.xsd">
<FileFormats>
<FlatFileFormat Name="FFF_AFRShareTable" ColumnNamesInFirstDataRow="true"
FlatFileType="Delimited" IsUnicode="false" TextQualifer="None" HeaderRowsToSkip="6">
<Columns>
<Column Name="Quote Buy" ColumnType="Delimited" DataType="AnsiString" Length ="50" Delimiter=","></Column>
<Column Name="Quote Sell" ColumnType="Delimited" DataType="AnsiString" Length ="50" Delimiter=","></Column>
<!-- Change -->
<Column Name="Div c per share" ColumnType="Delimited" DataType="AnsiString" Length ="50" Delimiter="CRLF"></Column>
</Columns>
</FlatFileFormat>
</FileFormats>
<Connections>
<FlatFileConnection Name="FF_AFRShareTable" FileFormat="FFF_AFRShareTable"
FilePath="C:\ssisdata\so\input\Stocks.csv"></FlatFileConnection>
<OleDbConnection Name="CMD DB"
ConnectionString="Data Source=Localhost\dev2014;Initial Catalog=tempdb;Provider=SQLNCLI11.1;Integrated Security=SSPI;"
CreateInProject="false">
</OleDbConnection>
</Connections>
<Packages>
<Package Name="so_37641290_AFR_ShareTableBIML" ConstraintMode="Linear" ProtectionLevel="DontSaveSensitive">
<Tasks>
<ExecuteSQL Name="SQLTask OLE_DB Truncate Security Share Table" ConnectionName="CMD DB">
<DirectInput>truncate table Staging.SecurityShareTable</DirectInput>
</ExecuteSQL>
<Dataflow Name="Data Flow Import Share Table CSV">
<Transformations>
<FlatFileSource Name="Source Flat File Share Table" ConnectionName="FF_AFRShareTable"></FlatFileSource>
<DerivedColumns Name="DER_NullifyColumns">
<Columns>
<Column Name="DER_DPS" DataType="Decimal" Precision="4"><![CDATA[[Div c per share] == "-" ? NULL(DT_DECIMAL, 4) : (DT_DECIMAL, 4)[Div c per share]]]></Column>
</Columns>
</DerivedColumns>
</Transformations>
</Dataflow>
</Tasks>
</Package>
</Packages>
</Biml>
The above biml works for me. Changes I made:
removed { and } from the tasks and component names
updated the last Column definition within your FlatFileFormat Columns collection to have a delimiter of CRLF instead of ,
I used the CDATA tag for the expression. Not needed here but if you had a > or < in there, then you'd need to escape them as either < or the CDATA approach as I used.
I also cleaned up the Derived Column's entity assignments. There were spaces around the equals and I don't believe those are supposed to be there.
Path updates for flat file + OLE DB to work with my setup.
Source data
0
1
2
3
4
5
Quote Buy,Quote Sell,Div c per share
1,1,1
2,2,2
3,3,-
Results

ReportViewer 9.0 and Visual Studio 2010

I am making an application to make Reports using visual studio 2010. Due to old ajax already used in the website, we can not use ReportViewer 10.0. So I am using Report Viewer 9.0 to generate reports.
When I run the Application I am getting the following error:
An error occurred during local report processing.
The definition of the report 'Main Report' is invalid.
The report definition is not valid. Details: The report definition has an invalid target namespace 'http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition' which cannot be upgraded.
I have changed the 10.0 ReportViewer references with the 9.0 one's. My web.config is as follows:
<?xml version="1.0"?>
<configuration>
<system.web>
<httpHandlers>
<!--<add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" validate="false" />-->
<add verb="*" path="Reserved.ReportViewerWebControl.axd" type = "Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</httpHandlers>
<compilation debug="true" targetFramework="4.0">
<buildProviders>
<!--<add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />-->
<add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.Common, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
</buildProviders>
</compilation>
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<handlers>
<!--<add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />-->
<add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
</handlers>
</system.webServer>
</configuration>
And my Page's code is as follows:
<%# Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%# Register assembly="Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" namespace="Microsoft.Reporting.WebForms" tagprefix="rsweb" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%--<%# Register assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" namespace="Microsoft.Reporting.WebForms" tagprefix="rsweb" %>--%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<rsweb:ReportViewer ID="rs" runat="server" Font-Names="Verdana" Font-Size="8pt"
InteractiveDeviceInfos="(Collection)" WaitMessageFont-Names="Verdana"
WaitMessageFont-Size="14pt">
<LocalReport ReportPath="Report.rdlc">
<DataSources>
<rsweb:ReportDataSource DataSourceId="ObjectDataSource1" Name="DataSet1" />
</DataSources>
</LocalReport>
</rsweb:ReportViewer>
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server"
SelectMethod="GetData" TypeName="dtAuditTableAdapters.ADT_AuditTableAdapter">
</asp:ObjectDataSource>
</div>
</form>
</body>
</html>
Need solution for below error:
An error occurred during local report processing.
The definition of the report 'Main Report' is invalid.
The report definition is not valid. Details: The report definition has an invalid target namespace 'http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition' which cannot be upgraded.
Just replace your datasource
<rsweb:ReportDataSource DataSourceId="ObjectDataSource1" Name="DataSet1" />
with
<rsweb:ReportDataSource DataSourceId="ObjectDataSource1" Name="dtAuditTableAdapters" />
I hope it will help you.
Hmmm Looking at the code you have posted you still seem to be using Version=10.0.0.0, in
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<handlers>
........Microsoft.ReportViewer.WebForms, Version=10.0.0.0, ...
</handlers>
</system.webServer>
change Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
to
Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
and then it should work
HTH