Solved

SQL Create Table Decimal

Posted on 2014-10-20
3
166 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 47

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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

772 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