Archive for the 'SSIS' Category
SSIS SQL Command Component Inline Comments
Tuesday, August 14th, 2007The SQL Command OLE DB component doesn’t like inline comments when using the Native SQL Server OLEDBConnection. Leave them in your SQL Code and you get the following error:-
An OLE DB error has occurred. Error code: 0×80004005. An OLE DB record is available. Source: “Microsoft SQL Native Client” Hresult: 0×80004005 Description: “Syntax error, permission violation, or other nonspecific error”.
Take them out and hey presto…
SSIS Pivot Component Example
Thursday, August 2nd, 2007It may be me, but as yet I haven’t seen too much written about the SSIS pivot and unpivot components.
Whilst they are not the easiest to configure, when faced with the option of importing to SQL Server and using a UNION or the new PIVOT clauses, I actually prefer the SSIS component.
Rather than actually explain the component, I thought it might be useful to go through a real example, so here goes…
SSIS & Excel (Part 2)
Monday, March 5th, 2007More Excel woes with SSIS…
Be very careful when using Excel as your transformation destination. Given that it is hard to maintain a consistent controlled version of any excel file you are using, it can be very prone to fail on account of the encoding that is used within it.
A sproc as an OLE DB Source
Wednesday, February 14th, 2007Remember when you use a Stored Procedure as the OLE DB Source that you need to turn off the ‘x many rows affected’ statement at the end.
Do this by including in the CREATE PROCEDURE script the statement:
SET NOCOUNT ON
Also, ensure that you make the full call to the procedure:
EXEC spStoredProcedure @myString = ?, @myInteger = ?
This makes parameter mapping much easier, however, don’t expect to be able to preview the data… this only seems to work at run-time.
Tokenize a String
Tuesday, February 13th, 2007We try to avoid SQL Server user-defined functions unless we can be certain that there is no other way to achieve what it is we’re asking of them. They aren’t very performant as they calculate on a row by row basis rather than the set based operations that our esteemed RDMS is renowned for.
Having said this I am going to post a table function I created recently for use as part of an SSIS import package that transforms an incoming single row CSV into roughly 100 records each time it runs.
The content team in our organisation faces the soul-destroying task of entering records as well as comma delimited strings on to an Excel spreadsheet which in turn is imported into 2 SQL tables.
There is no straight forward way to split the csv string into a SELECT list, but here is what I have done…
Excel & SSIS (Part 1)
Monday, January 15th, 2007Came across an irritating behaviour with the Excel source in SSIS. The Excel ODBC Jet Driver that SSIS uses has the annoying default configuration of only checking the first 8 lines in a spreadsheet, to evaluate the field length of any external columns in the Excel source task…
An Unreliable Source
Thursday, December 14th, 2006I recently had a problem with a new source I was asked to load into the data warehouse. I’m sure its quite familiar to many…

