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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 SSIS and Import/Export (2005)
 SSIS/VB 2008 Question
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

tooba
Posting Yak Master

224 Posts

Posted - 09/03/2014 :  17:32:13  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

USA
1834 Posts

Posted - 09/03/2014 :  19:16:14  Show Profile  Reply with Quote
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 - 09/03/2014 :  22:01:30  Show Profile  Reply with Quote
Yes.
Go to Top of Page

Bustaz Kool
Flowing Fount of Yak Knowledge

USA
1834 Posts

Posted - 09/04/2014 :  11:34:26  Show Profile  Reply with Quote
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 - 09/04/2014 :  17:53:34  Show Profile  Reply with Quote
I got it, Here is vb Code

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

Thank You.
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.04 seconds. Powered By: Snitz Forums 2000