Data Types in SQL Server

Công Nghệ



Data Types in SQL Server

CORRECTION: for storing DECIMAL you need to just count the numbers in precision and scale, like to store 100.55 you have to define like DECIMAL(5,2)

Check my blog for more details and SQL Queries:

“SQL Server Basics” series:
#SQLwithManoj #SQLServer #SQLDataTypes

SQL blog at:
LinkedIn:
Facebook:
Telegram:

Nguồn: https://bus-rush.info/

Xem thêm bài viết khác: https://bus-rush.info/cong-nghe/

27 thoughts on “Data Types in SQL Server

  1. CORRECTION: for storing DECIMAL you need to just count the numbers in precision and scale, like to store 100.55 you have to define like DECIMAL(5,2)

  2. Why would these two select statements have two different results, when the value stored inside the variable is the exact same as the string?

    DECLARE @x VARCHAR

    SET @x = 'aRandomString'

    SELECT DATALENGTH(@x)
    SELECT DATALENGTH('aRandomString')

  3. when i try to multiply 2 decimal value by a triger … it gives integer result .. is there any way to solve this ?

  4. Manoj, I really liked this Video. Its amazing dear because its small, clear and crispy.
    Wish many more such videos on SQL 2019 Edition as well !!!!

  5. Manoj, I think you miss-stated the definition of DECIMAL. The p, precision, is the number of digits to the left plus the number of digits to the right of the decimal point. But not counting the decimal point. To hold your 100.55 would be DECIMAL(5, 2). Try it and see for yourself.

  6. Greetings, Manjo. Thank you for the tutorial.

    I am trying to create a table for user registration and login,
    where I want to store passwords with MD5-hash.
    I have read that MD5-hash strings are 128 bits long,
    but when I try to specify bit(128) as the datatype for column "password",
    I get this error-message:

    #1439 – Display width out of range for column 'password' (max = 64)

    PS: I am using PHPMyAdmin to administer the SQL-database.

  7. Hello Manoj,

    The Create table was very useful, but I think I forgot to designate a place for it in the AdventureWorks2014 Table. I can make a select statement. Could you tell me, or show me the video in which you explain how to move a table? Thanks!

  8. Hi Manoj,

    As you mentioned, Tinyint is 1 byte and start from "0 to 255". where as 1 Byte = 1 character right, how come its "0 to 255"

    Please let me know

Leave a Reply

Your email address will not be published. Required fields are marked *