Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SSIS and Import/Export (2005)
 SSIS/VB 2008 Question

Author  Topic 

tooba
Posting Yak Master

224 Posts

Posted - 2014-09-03 : 17:32:13
Hi Guys,

I am using Row Count Transformation, from row count I am getting 1,2,3,4....., however I want 00000001,00000002,00000003...... I got it in
derived column with this expression
New Derived Column = RIGHT("00000000" + (DT_WSTR,8) Row_Column,8)

My question is how I can use above expression in Microsoft Visual Basic 2008. I have total count value as in variable. For Example
My total count variable value is 148, I want to print on my header 00000148. I am using Script Task for footer in flat file in SSIS.

Any advise?

Bustaz Kool
Master Smack Fu Yak Hacker

1834 Posts

Posted - 2014-09-03 : 19:16:14
Is the "total count variable" an integer?



Too often we enjoy the comfort of opinion without the discomfort of thought. - John F. Kennedy
Go to Top of Page

tooba
Posting Yak Master

224 Posts

Posted - 2014-09-03 : 22:01:30
Yes.
Go to Top of Page

Bustaz Kool
Master Smack Fu Yak Hacker

1834 Posts

Posted - 2014-09-04 : 11:34:26
Since its an integer, can't you convert it to a string, prepend the string of zeroes and then take the RIGHT X digits (Just like you have in the code you supplied)? Sorry to appear dense but what is the issue?



Too often we enjoy the comfort of opinion without the discomfort of thought. - John F. Kennedy
Go to Top of Page

tooba
Posting Yak Master

224 Posts

Posted - 2014-09-04 : 17:53:34
I got it, Here is vb Code

(Right("00000000" & Row_Colum, 8))

Thank You.
Go to Top of Page
   

- Advertisement -