Problem with Decimal Places in Field - MS SQL SERVER 2005 COMPACT

L

Loogie

Hello

How do I add a numeric field that allows 2 places of decimals. I want it
for the field p_len below. I tried p_len decimal(2) but it does not
work. I can only get p_len numeric(3) to work but that only stores a
small int.

I checked my references and I have System.Data.SqlServerCe Version
3.03600.0. I assume that is reference to MS SQL SERVER 2005 COMPACT that
I installed a few days ago.

What am I doing wrong?

Thanks

:L

sqlCreateTable.CommandText = "CREATE TABLE product(p_item int
IDENTITY(1,1) PRIMARY KEY NOT NULL, p_code NVARCHAR(1) NOT NULL, p_name
NVARCHAR(255) NOT NULL, p_min numeric(3) NOT NULL, p_top numeric(3) NOT
NULL, p_len numeric(3) NOT NULL, p_units NVARCHAR(10) NOT NULL,
p_speclist NVARCHAR(100) NOT NULL, p_notes NVARCHAR(255) NULL, p_verify
NVARCHAR(3) NOT NULL)"
 
R

Russell Fields

declare p_len decimal(9,2) -- 9 digits, 7 before and 2 after the decimal
point.

RLF
 
L

Loogie

Russell said:
declare p_len decimal(9,2) -- 9 digits, 7 before and 2 after the decimal
point.

RLF

Why would I be getting the error:

The specified data type is not valid. [ Data type (if known) = decimal ]

:L
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top