cast and convert

  • How can i convert this as bigint ?

    sum(size*8) as DBSize

  • Tara-1044200 (10/6/2009)


    How can i convert this as bigint ?

    sum(size*8) as DBSize

    sum(cast(4 as bigint)*8) as DBSize

  • Thanks for the answer mark, here's an example with a table create and some values.

    create table TEST

    (

    size1 int

    )

    insert into test values (1)

    insert into test values (2)

    insert into test values (50)

    select sum(cast(size1 as bigint)*100) as DBSize from TEST

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

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