none
Convert bytes to megabits in SQL script RRS feed

  • Question

  • Hi,

    What is the recommended way to convert bytes to megabits (Mb) in a SQL script?

    SELECT MAX (Value) / 1024
    FROM Database1 

    What would be the correct calculation?

    Thanks

    Tuesday, August 15, 2017 3:21 PM

Answers

  • Hi,

    that would result in Kilobytes.

    Try dividing by 131072 (or 1024 * 128)

    Cheers,
    Fred


    There's no place like 127.0.0.1

    • Marked as answer by RackHat Tuesday, August 15, 2017 5:35 PM
    Tuesday, August 15, 2017 3:29 PM

All replies

  • Hi,

    that would result in Kilobytes.

    Try dividing by 131072 (or 1024 * 128)

    Cheers,
    Fred


    There's no place like 127.0.0.1

    • Marked as answer by RackHat Tuesday, August 15, 2017 5:35 PM
    Tuesday, August 15, 2017 3:29 PM
  • $bytes/1Mb

    $bytes = 33Gb
    $bytes/1Mb


    \_(ツ)_/

    Tuesday, August 15, 2017 4:30 PM
  • Hi,

    What is the recommended way to convert bytes to megabits (Mb) in a SQL script?

    SELECT MAX (Value) / 1024
    FROM Database1 

    What would be the correct calculation?

    Thanks


    For SQL Server you should post in the T-SQL forum.

    \_(ツ)_/

    Tuesday, August 15, 2017 4:31 PM
  • Thank you!
    Tuesday, August 15, 2017 5:36 PM
  • My apologies, I will ensure to post under that forum next time. 
    Tuesday, August 15, 2017 5:36 PM