I need to add a "TransactionID" to a file - it will be a number that uniquely identifies each record. Must be all numeric characters, use leading zeros to complete the field. The data type is text with max length of 12.
So a 1 would be "000000000001" and if the number is 1657 then it should print "00000001657".
I did this but the TransactionID doesn't have leading zeros so I need help to add the leading zeros. I'm using SQL Server Management Studio.
CREATE TABLE TMP_TOC_FINAL (
Agency_Code VARCHAR(3)
, Consumer_ID INT
, Program_Area_ID INT
, Discharge_Status VARCHAR(2)
, Admit_Date NVARCHAR(20)
, Discharge_Date NVARCHAR(20)
, TransactionID INT identity (1,1) Primary key
The real programmer left and I'm trying my best to fix where he left off.
Thanks!