About 1,780,000 results
Open links in new tab
  1. SQL Server DECIMAL Data Type - GeeksforGeeks

    Dec 12, 2023 · Creating Table. Let's create a table called Transactions which includes TransactionID and Amount as columns. CREATE TABLE Transactions (TransactionID INT PRIMARY KEY, Amount DECIMAL(8, 3) -- Total 8 digits, 3 digits after the dot); Inserting Data. Let's insert some data into the Transactions table.

  2. decimal and numeric (Transact-SQL) - SQL Server | Microsoft Learn

    Mar 31, 2025 · A. Create a table using decimal and numeric data types. The following example creates a table using the decimal and numeric data types. Values are inserted into each column. The results are returned by using a SELECT statement.

  3. Understanding the SQL Decimal data type - SQL Shack

    Jul 15, 2019 · Let’s quickly create a new table, named Patients, that makes use of decimal data type for columns height and weight. We will insert a few rows using an INSERT clause as shown below for the demo purposes. Once the data is populated in the table, we can query this data using SELECT statement as shown below.

  4. How to store decimal values in SQL Server? - Stack Overflow

    I'm trying to figure out decimal data type of a column in the SQL Server. I need to be able to store values like 15.5, 26.9, 24.7, 9.8, etc. I assigned decimal(18, 0) to the column data type but this not allowing me to store these values. What is the right way to do this? DECIMAL(18,0) will allow 0 digits after the decimal point.

  5. How to change data type of a column in an SQL table from integer to decimal

    Table is dbo.Budget and the column concerned is called ROE. Easy - just run this SQL statement. ALTER COLUMN ROE DECIMAL(20,2) -- or whatever precision and scale you need..... See the freely available MSDN documentation on what exactly the precision, scale and length in decimal numbers are and what ranges of values are possible.

  6. An Essential Guide To SQL Server DECIMAL Data Type

    Summary: in this tutorial, you will learn about the SQL Server DECIMAL data type and how to use it to store exact numeric values. To store numbers that have fixed precision and scale, you use the DECIMAL data type. The following shows the syntax of the DECIMAL data type: Code language: SQL (Structured Query Language) (sql) In this syntax:

  7. sql - How do I create a decimal field in Access with Alter Table ...

    Nov 22, 2016 · You have to use the SQL Server compatibility syntax (ANSI 92) setting to use the decimal data type in the SQL Window. Click on the menu, Tools > Options. Click on the Tables/Query tab. Mark the check box for "This database" in the SQL Server compatibility syntax (ANSI 92) section.

  8. Mastering the DECIMAL Data Type in SQL Server

    We will also provide an example of creating a table with DECIMAL and NUMERIC columns, querying data from the table, and attempting to insert values exceeding precision and scale. The DECIMAL data type in SQL Server is used to store numeric values with fixed precision and scale. The syntax for DECIMAL is as follows: DECIMAL (p, s)

  9. SQL Server DECIMAL: Everything you need to know

    Aug 23, 2021 · We will discuss the following topics about the SQL Server DECIMAL data type: Let’s start from topic 1.00. 1. An example of using a SQL Server DECIMAL data type. Let’s create a simple table called Books, which will have a DECIMAL column to store the Price of a book: The syntax for DECIMAL is this: DECIMAL(p, s) The “ p ” stands for “Precision”.

  10. SQL Decimal: Guide and Examples - Database Star

    Jan 5, 2024 · Let’s see some examples of creating an SQL DECIMAL data type, including how to insert data into a decimal and how to select data. This example shows how to create a new table with a decimal field. account_id INT, account_name VARCHAR(200), account_balance DECIMAL(20,2) This example uses an account_balance column with a DECIMAL data type.

Refresh