I am working with an existing table using SQL. I have to insert the following data into this table. This is a homework Question! Below is the question and my code. I keep getting the following error.....Cannot insert the value NULL into column 'ProductID', table 'jc0541535.dbo.Products'; column does not allow nulls. INSERT fails. How do i get this ProductId to automatically generate?
- ProductID: The next automatically generated ID
- CategoryID: 4
- ProductCode: dgx_640
- ProductName: Yamaha DGX 640 88-Key Digital Piano
- Description: Long description to come
- ListPrice: 799.99
- DiscountPercent: 0
- DateAdded: Today's date/time
use column list for this statment
< This is the code that I used but it is not working properly. Can someone please point out why.
INSERT INTO Products (ProductID,CategoryID,ProductCode,ProductName,Description,ListPrice,DiscountPercent ,DateAdded) VALUES(DEFAULT,4,'dgx_640','Yamaha DGX 640 88-Key Digital Piano', 'Long description to come.',799.99,0,CURRENT_TIMESTAMP);