how to convert float to integer

  • in sql server 2005 i need to update a column of table from float to integer. How do I do it using either

    conversion or cast or is there any other way??

  • There are some functions, you can use. Choose appropriate one:

    declare @i int

    declare @f float

    set @f = 3.789

    set @i = cast(@f as int)

    select @i

    set @i = round(@f, 0)

    select @i

    set @i = floor(@f)

    select @i

    set @i = ceiling(@f)

    select @i

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply