IF you want to display only once in a while, You can use it like this
SELECT RIGHT('000000'+CONVERT(varchar, pk_PRODUCTID), 6) AS ProductCode
Otherwise add an additional (Computed) column using the format. But it is not a recommended solution for a highly used production system.
G.R.Preethiviraj Kulasingham
|