有这样一个业务场景,数据库中有一列是整形,如: 12,43,1,5 等
现在要求统一输出5位字符格式的字符值,如:00012,00043,00001,00005
实现方式如下:
RIGHT(REPLICATE("0", 5) + (DT_WSTR, 5)[IntegerColumn], 5)
Replace "5" with the desired width. The above expression generates a string value, not a numeric.