Showing posts with label component. Show all posts
Showing posts with label component. Show all posts

Monday, March 26, 2012

How to get the name of the error column from the errorcolumn output

Hi,

Iam redirecting the error output of a OLEDB destination component to a script component. My aim is to create a HTML report having the information about the bad records, the error occuring in the rows and the column name that fails. The error output provided two new columns i.e the errorcode and errorcolumn , the errorcolumn value for a bad record gives the linage id for the column, is there a way to derieve the name of the column by using the lineage id?

Regard,

pritesh

Possible, but not trivial. MS seem to consider this a design-time lookup, so you could use something that queries the package structure to get the info. Simon has written a transform that does this as well, note it needs both outputs to be able to get all the metadata. http://sqlblogcasts.com/files/3/transforms/entry2.aspx|||Thanks for the info , i will try to implement it. It sounds useful !|||

Anonymous wrote:

Thanks for the info , i will try to implement it. It sounds useful !

And if you want to continue posting here, please change your display name from Anonymous to something else. Microsoft staff will be cleaning up those accounts with display names of Anonymous.

Monday, March 19, 2012

How to get started on custom Merge Join component?

I need to extend the functionality of the Merge Join transformation to allow more complex joining scenarios. I have found some quickstarts on custom components (i.e. Hash Transform, etc.), however I haven't found any good references on more advanced tasks like processesing multiple inputs. Any ideas?

TIA,

Matthew

First as a disclaimer I would advise against this, as writing a multi imput component is significantly more complex that writing a single input component due to the threading that needs to be done in just about all scenarios.

With that said you can look at any of the samples that have async outputs as a good starting point. The additional complexity comes from the fact that you will, most likely, need to implement your own threading in order to do the merging. This means you will need to make a copy of the buffers to pass to your thread that does the merging. You need this threading because depending on the package both of your inputs could be called on the same thread and if you just waited on one input for the other input to get data then you would hang. All the stock multi input components do their own threading except for UnionAll because that one doesn't have any inter input dependencies to write the data to it output.

HTH,
Matt

|||Matt,

Thanks for the reply. I haven't seen any samples showing async outputs. Could you post a link?

Thanks!

Matthew|||BOL has a RemoveDuplicates sample which has an async output. You can look for sample applications[Integration Services] in the index.

Matt

Wednesday, March 7, 2012

How to get only date component from a datetime column

Hi all,

I have a table containing a datetime column and it stores date with time ( I use GETDATE() to store the value ). For reporting purpose I need only the date component from this column without the time component. I do not want to use the datepart(yyyy, orderdt), datepart(mm, orderdt) and datepart(dd, orderdt).

Will following help

select CONVERT ( VARCHAR (10) , GetDATE(), 121 )

Friday, February 24, 2012

how to get last year revenue up to a specific month

Please help

i have a office web component pivot table that pulls revenue for 2005 ([Measures].[Rev],[Date].[2005]). This shows all revenue to May 2005. I also want to display all revenue for 2004 (up to may).

I was trying to hard code the month but was unsuccessful. Here's what I tried:

([Measures].[Rev], ([Date].[2004].[Quarter 1].[January],[Date].[2004].[Quarter 1].[February],[Date].[2004].[Quarter 1].[March],[Date].[2004].[Quarter 2].[April],[Date].[2004].[Quarter 2].[May]))

..

|||You have to make a calculated member.

Try this
MEMBER [Measures].[Rev To May 2004] AS ' SUM({[Date].[2004].[January]:[Date].[2004].[May]}, [Measures].[Rev]) '
If you want is to always show the same period you should make something like this.
MEMBER [Measures].[Rev To May 2004] AS ' SUM({PARALLELPERIOD([Date].[Year], 1, [Date].CURRENTMEMBER.FIRSTCHILD.FIRSTCHILD : PARALLELPERIOD([Date].[Year], 1, [Date].CURRENTMEMBER}, [Measures].[Rev]) '

(This works if your dimension has these levels year, quarter, month, day
I hope it helps you.