To print multiple int variables on one line you need to CAST them first. Otherwise the PRINT command will add them up (at least it does for me anyways using SQL 2008). In the example I needed to have two ID variables print out while I was working on a sproc so I could see if I was getting the correct IDs before adding in my update code.
This did not work, it adds the two variables together:
PRINT @FirstID + ‘ – ‘ + @NextID
This does work, it prints each variable with the dash in-between:
PRINT CAST(@FirstID AS Varchar(20)) + ‘ – ‘ + CAST(@NextID AS Varchar(20))