I have a problem when i create a table in SQL Server
once i chose DOUBLE as the data type, the error jumped on my face !!!
THIS is the following code :
CREATE TABLE BATCH
( Product_Name VARCHAR(200) NOT NULL,
Product_Brand VARCHAR(100) NOT NULL,
CONSTRAINT Price_FK FOREIGN KEY (Product_Name,Product_Brand)REFERENCES Product (Product_Name,Product_Brand),
BATCH_Date AS GETDATE(),
BATCH_OriginalPrice DOUBLE NOT NULL DEFAULT 0,
BATCH_TAX DOUBLE NOT NULL DEFAULT 0,
BATCH_ProductCost DOUBLE NOT NULL DEFAULT 0 ,
)
The error is like this after each double Incorrect syntax near the keyword 'NOT'
and when i pass the mouse over it, it says " Incorrect syntax near 'NOT'. Expecting ID "
Can someone tell me what's the problem !!!
double
isn't a data type in SQL, you'll have to use float
or real
.
With your example you could use money
as well.
related: What represents a double in sql server?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With