I am using SQL Server 2008. I have made a new numeric column called unique_number and I would like to populate this column by concatenating two other numeric columns called site and number. The site column ranges from 1-31 and the values smaller than 10 do not have a zero in front of them. I Would like the following
Number Site unique_number
1234567 2 12345672
3456789 26 345678926
Using the + I have been able to get unique_number to be the sum of the two columns, but I want a concatenation to occur, not a summation. I've tried other suggestions using cast as varchar, but the select statement continues to give me errors. Is there a reasonable way to do this?
Numberalways have 7 digits (and if not how will you know if12345622is123456,22or1234562,2)