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

cant add output to xml adapter source

$
0
0

Hi we run 2012 std.  I have an xml adapter whose xsd looks similar to what is shown below.  I'm struggling with what the obstacle might be for adding an output that contains report-date and some-name (see 6th and 7th lines down).  All other outputs seem fine.   They include customers, customer, asset contents, asset item and summary.

<?xml version="1.0"?><xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"><xs:element name="some-report"><xs:complexType><xs:sequence><xs:element minOccurs="0" name="report-date" type="xs:string" /><xs:element minOccurs="0" name="some-name" type="xs:string" /><xs:element minOccurs="0" name="customers"><xs:complexType><xs:sequence><xs:element minOccurs="0" maxOccurs="unbounded" name="customer"><xs:complexType><xs:sequence><xs:element minOccurs="0" name="account-id" type="xs:unsignedInt" /><xs:element minOccurs="0" name="name" ><xs:simpleType><xs:restriction base="xs:string"><xs:maxLength value = "255"/></xs:restriction></xs:simpleType></xs:element><xs:element minOccurs="0" name="cash" ><xs:simpleType><xs:restriction base="xs:string"><xs:maxLength value = "15"/></xs:restriction></xs:simpleType></xs:element><xs:element minOccurs="0" name="asset-contents"><xs:complexType><xs:sequence><xs:element minOccurs="0" maxOccurs="unbounded" name="asset-item"><xs:complexType><xs:sequence><xs:element minOccurs="0" name="assetident" ><xs:simpleType><xs:restriction base="xs:string"><xs:maxLength value = "255"/></xs:restriction></xs:simpleType></xs:element><xs:element minOccurs="0" name="description" ><xs:simpleType><xs:restriction base="xs:string"><xs:maxLength value = "1000"/></xs:restriction></xs:simpleType></xs:element><xs:element minOccurs="0" name="quantity" type="xs:unsignedShort" /><xs:element minOccurs="0" name="value" ><xs:simpleType><xs:restriction base="xs:string"><xs:maxLength value = "15"/></xs:restriction></xs:simpleType></xs:element></xs:sequence></xs:complexType></xs:element></xs:sequence></xs:complexType></xs:element><xs:element minOccurs="0" name="total-value" ><xs:simpleType><xs:restriction base="xs:string"><xs:maxLength value = "15"/></xs:restriction></xs:simpleType></xs:element></xs:sequence></xs:complexType></xs:element></xs:sequence></xs:complexType></xs:element><xs:element minOccurs="0" name="summary"><xs:complexType><xs:sequence><xs:element minOccurs="0" name="category1" type="xs:decimal" /><xs:element minOccurs="0" name="category2" type="xs:decimal" /><xs:element minOccurs="0" name="category3" type="xs:decimal" /><xs:element minOccurs="0" name="category4" type="xs:decimal" /></xs:sequence></xs:complexType></xs:element></xs:sequence></xs:complexType></xs:element></xs:schema>


SSIS Conditional Split small problem comparing dates

$
0
0

Hi All,

I have an SSIS package that i'm trying to write that is pretty basic: reads from a csv, I want to filter the incoming rows to only insert rows from yesterday, then load into db.

I have a Flat File Source --> Conditional Split --> OLE DB destination

In the Conditional Split however, I am having problems trying to create the condition that will only insert rows where [date] column is of yesterday.

The [date] column however, is a varchar column in the format yyyy-mm-dd so I figure I have to convert/cast it to a date or datetime.

I tried using this but I cant get it non-red!

DATEPART( "DAY", CAST([Date] as datetime)  ) ==  DATEPART( "DAY", getdate() -1)

The error is:

Attempt to parse the expression ,,, failed. The expression might contain an incomplete token, invalid token or an invalid element.

if I take that and put it in a select, it works fine, but within the Conditional Split I don't quite know the proper syntax

Thanks in advance

Constarint Expression Fails

$
0
0

I have Precedence Constraint using an expression

@[User::CurTranCount] is decalred Int32

@[User::BT01] is declared string

@[User::MM] is declared string

Although the two strings are in a sense decimals in SQL I have converted them to strings as the 'values' form part of a 'product name which is a string that is I do a lookup on a table

what I want to do is check if CurTransCount multiplied by BT01 is less than MM.

my expression below fails with

Error code 0x80070057 occurred attempting to convert from data type DT_WSTR to data type DT_NUMERIC.

Casting expression "@[User::BT01]" from data type "DT_WSTR" to data type "DT_NUMERIC" failed with error code 0xC00470C2.

( @[User::CurTranCount] *    ((DT_NUMERIC, 11, 2) @[User::BT01]))  <  ((DT_NUMERIC, 11, 2) @[User::MM])


Dont ask me .. i dont know

Issue to export data from sql to excel

$
0
0

I have MS SQL 2008 Developer version and visual studio 2008. I'm using SSIS Import and Export Wizard on the VS2008 to create a simple package to export data from a table using a sql query to excel file (.xlsx), but I got the following error messages:

[Destination - Query [37]] Error: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80040E21.

[Destination - Query [37]] Error: Cannot create an OLE DB accessor. Verify that the column metadata is valid.

[SSIS.Pipeline] Error: component "Destination - Query" (37) failed the pre-execute phase and returned error code 0xC0202025.

The SQL query is

SELECT [BusinessEntityID]
      ,[PersonType]
      ,[NameStyle]
      ,[Title]
      ,[FirstName]
      ,[MiddleName]
      ,[LastName]
  FROM [AdventureWorks2008].[Person].[Person]

Any help will be appreciated. Thanks.


A Fan of SSIS, SSRS and SSAS

handling CSV Files with commas embedded in quoted strings (BUG or what ???

$
0
0

Hello Everyone 

I am having this issue where 

I have data with " as qualifiers and , as delimeters 

col1,col2,col3,col4,col5

1,"sce rd. ,unit4","","hh",23

2,"main st,apt7","","ffh",23

4,"main ave,unit2","","hgg",23

My problem is when i try to import the csv file to my table, i get the error, because of the (delimeters is in the string itself) in some of the records. 

Even there is a quotes as text qualifier, ssis is parsing every (delimeter value to a new column and that is pussing the data to the wrong columns, 

What is the fix for this ,?? If any one could help me, I went through every resources online and all people show is script task and I am not familiar with it.. 

And most of them dont work also. 

Is there no way to get this fixed???

any one plz help 

thank you 

SSIS 2014 and DTexec

$
0
0

I have developped an SSIS package running on SQL Server 2014 on Windows server 2012. When I start the package in VS 2013 environment it works fine. I deployed the package to SSISDB and tried to run it from there, still successfully. But When I tried to launch my package from dtexec with the following statement in SSMQ the below error is displayed:

EXEC xp_cmdshell 'dtexec /ISSERVER"\SSISDB\MyFolder\MyProject\PKG Sales Debit.dtsx" /SER "ServerName\Instance" '

Error Message:

Remove Batch Worksheet:Error: Executing the query "Drop Table `Batch`" failed with the following error: "Cannot modify the design of table `Batch`. It is in a read-only database" Possible failure reasons: Problens with the query, "ResultSet" property not set correctly, parameters not set correclty, or connection not established correclty.

The drop batch is an execute sql task to remove worksheet named Batch in an excel file.




Patrick

SSIS Package creation method

$
0
0

I had a requirement with following database tables in database application

dimensions:

dim customer
dim distributor
dim country
dim currency
dim time

dim market

Measures: fac_billing

How can i create ssis package using these dimensions and fact table? can anyone provide an example to create a ssi s package using this method



Deploy a package in SSIS DB catalog and pass Config file dynamically in a SQL job

$
0
0

Hi,

I have a Package that needs to be deployed in SSIS Catalog DB.

Later I need to execute it through SQL Job.

Please let me know the steps how to do this and also I need to pass a Config file to run the package in SQL job.

Thanks,.

Sailaja


SSIS 2012 Failing to redirect failed records

$
0
0

Hi there,

In SSIS 2008R2, redirect failed records used to work correctly, unfortunatly, in the SSIS 2012 version i can seem to get any recrods to redirect upon failure.

For example, i have a column that is defined as intergre but when ever a mixed character value is fetch, i would be expecting to fail and redirec the record.  This used to happen in 2008 but in 2012, it doesnt redirect, but rather skips and continues to process next record.

Has anyone seen this issue?

Thanks in advance.

AB

The type of the value (DBNull) being assigned to variable "User::AlereCoachingEnrolledID" differs from the current variable type (Int32)

$
0
0

This occurred within an Execute SQL Task

I am trying to get my entire result set with the following SQL...

IF EXISTS
(
SELECT	[Alere_Coaching_Enrolled].[AlereCoachingEnrolledID]
FROM	[dbo].[Alere_Coaching_Enrolled]
WHERE	([Alere_Coaching_Enrolled].[MatchMember]	IS NULL
OR		 [Alere_Coaching_Enrolled].[MatchMember]	=	0)
AND		([Alere_Coaching_Enrolled].[Processed]		IS NULL
OR		 [Alere_Coaching_Enrolled].[Processed]		=	0)
)
	BEGIN
		SELECT	[Alere_Coaching_Enrolled].[AlereCoachingEnrolledID]
		FROM	[dbo].[Alere_Coaching_Enrolled]
		WHERE	([Alere_Coaching_Enrolled].[MatchMember]	IS NULL
		OR		 [Alere_Coaching_Enrolled].[MatchMember]	=	0)
		AND		([Alere_Coaching_Enrolled].[Processed]		IS NULL
		OR		 [Alere_Coaching_Enrolled].[Processed]		=	0)
	END
ELSE
	BEGIN
			SELECT	0	AS	[AlereCoachingEnrolledID]
	END

I want to handle using a Sequence Container and an Expression and Constraint if I have rows to process and if I do not...thus the 0 portion of the SQL...

Thanks for your review and am hopeful for a reply.

How to update a column with a new value based on the number of records in script component?

$
0
0

Hi All,

I have a business requirement where I need to update a column based on number of record count.

I tried using a script component and a variable I am not able to access the variable after running a script, the value is not changed.

Logic

Column1 to be updated based on below logic

No. of location 2

if there are 5 records with location A

if there are 10 records with location B

Need to update the column1 of records with location A as 20

and

update the column1 of records with location B as 30

I have tried using script component and the variables,

==============================

 Dim X As Integer = 0
 Dim Y As Integer = 0

Public Overrides Sub Input0_ProcessInputRow(ByVal Row As Input0Buffer)

If (Row.Location = "A")Then
            X= X + 1
ElseIf (Row.Location = "B") Then
            Y= Y+ 1
End If

Me.ReadWriteVariables("XX").Value = X
Me.ReadWriteVariables("YY").Value = Y

End Sub

======================================

Please help....

Thanks in Advance

Add new columns to flatfile connection

$
0
0

Hi,

I have created a package and completed the development. Now, client is requesting to add few more columns to the target flatfile. I don't want to delete the connection and flat file destination components and re-create the both to reflect the new columns. I have tried to open the Advanced tab in connection->Edit and added the new column say 'Column_new' and getting the below error while changing the ColumnDelimiter to Pipe |.

Error - Property Value is not valid

Please advise..

Thanks.

DTS_E_INDUCEDTRANSFORMFAILUREONERROR

$
0
0

Hi,

I am facing following error. 

[ABC ORACLE insert [2]]  Error: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80004005.
An OLE DB record is available.  Source: "OraOLEDB"  Hresult: 0x80004005  Description: "ORA-03113:
 end-of-file on communication channel
Process ID: 0
Session ID: 1177 Serial number: 348".

[ORACLE insert [2]] Error: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR.  The "ABC ORACLE insert.Inputs[OLE DB Destination Input]"
 failed because error code 0xC020907B occurred, and the error row disposition on "JFSL ORACLE insert.Inputs[OLE DB Destination Input]" 
specifies failure on error. An error occurred on the specified object of the specified component.  
There may be error messages posted before this with more information about the failure.

[SSIS.Pipeline] Error: SSIS Error Code DTS_E_PROCESSINPUTFAILED.  The ProcessInput method on component "ABC ORACLE insert" (2)
 failed with error code 0xC0209029 while processing input "OLE DB Destination Input" (15).
 The identified component returned an error from the ProcessInput method. 
The error is specific to the component, but the error is fatal and will cause the Data Flow task to stop running. 
There may be error messages posted before this with more information about the failure.

Kindly give your input.

Thanks,
Vivek Singh

SQL Agent job running DTS package running in SQL 2005 is unable to run if job onwer is not logged onto server

$
0
0

I am currently working on a SQL Server upgrade project for a a client where I am converting old dts packages to SSIS. However for a few of the packages no conversion is allowed to be done. For these few packages I have to use dts legacy components in SQL 2005 on a windows 2003 server to run them.

These packages use CAPICOM via an Active X script in the package to envelope connection string data for security within the package. Consequently I have to register the capicom.dll for the job owner (which will execute the job via proxy) and install private and public key files via internet explorer. I also do this when I am logged in with my account so i can test the package.

I have created a SQL Server Agent Job which is used to execute the package. We have a schedule account which is local admin on the server and sysadmin within SQL Server. This account is used to create a credential and then a proxy for the CmdExec subsystem is then created based on this credential. A CmdExec job step is then added to the job. The directory of  cmd file which calls the dts package is then entered in the command window.

Finally a recurring schedule is added to execute the job every 5 minutes. 

If i am logged in to the server using the scheduled account the schedule runs successfully. I am also able to run the command file manually by double clicking on it. The DTS package is run successfully. However once the schedule is set up and I log off the machine and log onto my development machine with my normal account and fire up  SQL Server. I connect to that instance with the schedule and see that the job is failing with and Active X error in the package. From experience with this package this Active X  error occurs when the user executing the package has not registered the capicom.dll. This has already been done for the scheduler account because the job runs when the scheduler account is logged in on the server. 

It almost seems as though the job will only run if the Scheduler account is logged on. If i log directly on to the server with own user account I am able to manually execute the package via the cmd file which indicates that the capciom.dll is registered under my account. Yet if I try an run the job in SQL Server when I am logged in under my account (using the scheduler account proxy) then the job fails.

Does anybody have any idea why this may be happening? Any ideas would be much appreciated

 

Problem with SSIS 2012 SCD & Sequences

$
0
0

I wonder if anyone can help?
I've set up a simple SSIS package to populate a Dimension for Data Warehouse POC project.
I am using the Slowly Changing Dimension transformation to handle this Type 2 dimension.
I have created the Dimension table at the destination and I have applied a PK using the new Sequence object available in SQL 2012.
To also let you know the source data for this dimension has a varchar PK as the primary reference column and is a mixture of alphanumeric characters (for invoicing). So, I am stuck with a varchar PK for now, unfortunately.

As the table loads I'm obviously expecting the PK values to be populated/"incremented" using the Sequence object (NEXT VALUE ...) but the SSIS package doesn't like this and errors immediately.

One forum mentions changing the OLE DB Destination properties for "Data Access Mode" to "Table or View - fast load" but I have tried this and doesn't work - still same error.

Are we saying that the Sequence object and the SCD transformation are incompatible or is there a workaround?

I have just run the package again to extract the error.
I made a simple change on one column at source to demonstrate the problem.
Here is part of the error:

Hresult: 0x80004005  Description: "Cannot insert the value NULL into column 'ACCDWKey', table '_Core.dbo.DimACC'; column does not allow nulls. INSERT fails.".

The SCD flows through ok but fails just at the "Insert Destination" part with above error.
So, the task does find the matching record in dimension and updates the old record "CurrentFlag" to 0.
However, it cannot insert the new row as the destination dimension demands that the PK contains a value (Sequence) and the task is not inserting a value because it is not fetching next value from sequence.

There doesn't appear to be an option for this with the SCD Wizard.

When I use the wizard, the screen "Select a Dimension Table and keys" the Dimension columns are detected and listed, however the only options are : original "business key" and "Not a key column" only. The PK of dimension (ACCDWKey) sits at the top with a space box on either side so I'm not sure how SQL Server is categorising this column.

I wish I could provide screenshots - it would be easier to explain.


getting xsd location from a variable

$
0
0
Hi we run std 2012.  In my xml file adapter I don't see an option for mapping the xsd source file to anything but a hardcoded value.  Is there a way to get the location from a variable?

Looping through text files loads all 2014 files correctly, but 2013 files only loads every other row

$
0
0

Hello all. I am once again stumped and would very much appreciate any help.

I have a folder with many text files such as this...

A 2013-03-31.txt

A 2013-06-30.txt

A 2013-09-30.txt

A 2013-12-31.txt

A 2014-03-31.txt

A 2014-06-30.txt

A 2014-09-30.txt

B 2013-03-31.txt

B 2013-06-30.txt

B 2013-09-30.txt

B 2013-12-31.txt

B 2014-03-31.txt

B 2014-06-30.txt

B 2014-09-30.txt

…and so on…

and I'm loading all of the files beginning with A to an existing table in SQL Server. I'm loading the data as is to a staging table, no data type conversions, and I add only two derived columns. I have a loop to accomplish this, and it's working perfectly except for one detail. All of the files in 2013 load every other row. All of the 2014 files load all rows as intended.

Any idea what would cause this? All files are being loaded using the same loop, same variables, same everything. My enumerator on the for each loop is Foreach File. The DataRowsToSkip property on the flat file connection manager is 0. I'm not sure where to look next. I need all rows in all files to be loaded.

Forgot to mention that there is a difference between the 2013 and 2014 files. The 2014 files have 8 additional columns. I suspect this is causing my issue, just not sure what to do about it.

Thanks for any help you can provide!


WeeLass


Viability of developing multiple versions of SSIS on same system.

$
0
0

What is the viability of developing different SSIS version jobs on the same machine (Windows 7 / 64-bit).  We currently have hundreds of versioned SQL Server 2008 SSIS packages and are wanting to begin migrating them to SQL Server 2014.  In addition to the packages themselves, custom tasks are implemented.  I understand that a new system configured for SQL Server 2014 only would resolve the issue, but as we have many developer machines and environmental servers, that is not an easy option to initiate. 

I started on my local machine with SQL Server 2008 installed with no SSIS developmental issues.  After installing SQL Server 2014 (most components), developing SSIS in the new version encountered no issues as well, however, code development within SSIS 2008 script task and script component exhibited reference related issues; Microsoft.SqlServer.Dts.Runtime in particular. The exact error describes a condition where Runtime does not have any public members. The Microsoft Visual Studio Tools for Applications (VSTA) environment appears to function properly, but it is as if the references / templates are for SQL Server 2014.  The strange thing is that we could still modify VB.NET script task code (with reference errors), but not C# and no script components at all.After uninstalling SQL Server 2014 except for Integration services and the Client Tools SDK, the impact issues to SSIS 2008 script coding appear to be resolved. 

Need help with Dynamic Excel File Name please.

$
0
0

I am try to output an excel file with dynamic date. Here what I done.

I am using SQL 2012.

  1. Create Execute SQL Task Connect Type: Excel
  2. Create Data Flow Task set to DelayValidation: True
  3. Create OLE DB Sourc
  4. Create Data Converstion
  5. Excel Destination
  6. Excel Connection, Expression, select ExcelFilePath
  7. @[User::sXLFilePath] +  @[User::sFileName] + RIGHT("0" + (DT_WSTR, 2) DATEPART("DD", GETDATE()), 2)+ RIGHT("0" + (DT_WSTR, 2) DATEPART("MM", GETDATE()), 2) + RIGHT((DT_WSTR, 4) DATEPART("YYYY", GETDATE()), 2) +".csv"
  8. C:\ExcelOutPut\SOX_CAM_SQL_Report_010215.xls

What I try to accomplish is output the file with each day append to it, date must be DDMMYY.

I google it and found many samples, tested it, and none of them is work for me. Any suggestions or some examples to share is greatly appreciate. I am new to SSIS.  I found one poster have similar issue and inside the posted below, there was one suggestion to create variable and connection string but how do I bind that variable to Excel Connection manger.

Please help.

Thank you so much in advance.

Ex: SOX_CAM_SQL_Report _020215.csv

       SOX_CAM_SQL_Report _030215.csv

     

--Similar issue:

https://social.msdn.microsoft.com/Forums/en-US/bda433aa-c8f8-47c9-9e56-efd20b8354ac/creating-a-dynamic-excel-file?forum=sqlintegrationservices

Suggestion in the above posted but where can bind this to Excel Connection Manger. Please help provide step by step.  Thanks.

"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\\temp\\" + "ExcelTarget" + (DT_WSTR,4)DATEPART("yyyy",GETDATE())  +".xls" + ";Extended Properties=\"EXCEL 8.0;HDR=YES\";"

And yes, as you were intimating, the delay validation on the dataflow should be set.

I created an Execute SQL Task in ssis package to get the counts and store it in the variable and I use the variable in the control flow

$
0
0

I always get the count as 0 for the variable. I am not sure what I am doing wrong. Please let me know if any of you know the fix.

Thanks

Viewing all 24688 articles
Browse latest View live


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