Solved

SQL Create Table Decimal

Posted on 2014-10-20
3
174 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 50

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
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

739 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