A column height is integer type in my SQL Server table. I want to do a division and have the result as decimal in my query:
height
Select (height/10) a
You can either cast Height as a decimal:
select cast(@height as decimal(10, 5))/10 as heightdecimal
or you place a decimal point in your value you are dividing by:
declare @height int set @height = 1023 select @height/10.0 as heightdecimal
see sqlfiddle with an example