Skip to content

Products table Price field decimals truncated #1

@RedAero

Description

@RedAero

Hi!

I don't know if his is RDBMS-dependent, but on MS SQL Server, the default decimal data type is decimal(18,0), which means 18 digit integers, essentially, nothing after the decimal point, so this script run as-is will truncate all the values in the Price column of the Products table to integers (despite maintaining the decimal type). The solution is simple, the table has to be created with something like a decimal(10,3) type, or float.

By the way, a similar issue could present itself with the varchar fields depending on the collation used, usually it's safer to use nvarchar.

Also, re: the whole reason this repo exists: I believe AndrejPHP's script runs only on MySQL, I don't think it's outdated or broken. But thanks for making a SQL Server compatible version anyway.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions