SSIS: How to pad with zeros to a integer in SSIS

My integer number can have value 1, 2, ….11,….124,..

My desired output is 0001.opt, 0002.opt,…..0011.opt

 

RIGHT(REPLICATE(“0”, 8) + (DT_WSTR, 8)[IntegerColumn], 8)

Replace “8” with the desired width.  The above expression generates a string value, not a numeric.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s