I have an integer value for month as a single digit. I want to cast it to a string an ensure that if it's less than 10 it will always have a 0 prepended to it. This what I am working on, but having trouble. Could you give advice? Thanks
DECLARE @month INT SET @month = REPLACE( CAST(1 as VARCHAR(2)), ' ', '0') SELECT @month AS month