Solved

SQL Create Table Decimal

Posted on 2014-10-20
3
160 Views
Last Modified: 2014-10-21
Hi

When I create a table using the following SQL statement the column [Total Stock]  seems to have
no decimal places. Do I have to specify the number of places eg Decimal(18,10)?

 CREATE TABLE MARA ([ID] bigint identity(1,1) not null primary key, [ValA] nvarchar(MAX), [Article] nvarchar(MAX), [Article description] nvarchar(MAX), [Total Stock] Decimal, [BUn] nvarchar(MAX),[MS] nvarchar(50))"
0
Comment
Question by:murbro
3 Comments
 
LVL 21

Assisted Solution

by:Dale Burrell
Dale Burrell earned 250 total points
ID: 40393634
Correct, or use a predefined format e.g. money which is 4dp (http://msdn.microsoft.com/en-nz/library/ms187752.aspx).
0
 
LVL 45

Accepted Solution

by:
Vitor Montalvão earned 250 total points
ID: 40393797
Yes, you need to provide the number of places:
[Total Stock] Decimal(18,10)
0
 

Author Closing Comment

by:murbro
ID: 40394225
Thanks very much
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

In this article—a derivative of my DaytaBase.org blog post (http://daytabase.org/2011/06/18/what-week-is-it/)—I will explore a few different perspectives on which week today's date falls within using Microsoft SQL Server. First, to frame this stu…
I wrote this interesting script that really help me find jobs or procedures when working in a huge environment. I could I have written it as a Procedure but then I would have to have it on each machine or have a link to a server-related search that …
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now