Interesting SQL Dilemma -- Need Help
Lets say I have a table with only a single field in it, which happens to be an identity field:
CREATE TABLE TestIds (
TestId int IDENTITY (1, 1) NOT NULL
)
How do I insert a new record into this table -- all of these I've tried so far have failed:
- INSERT INTO TestIds () VALUES ()
- INSERT INTO TestIds (TestId) VALUES ()
- INSERT INTO TestIds (TestId) VALUES (DEFAULT)
- INSERT INTO TestIds (TestId) VALUES (@@Identity)
- INSERT INTO TestIds (TestId) VALUES (1)
- INSERT INTO TestIds (TestId) VALUES (NULL)
- INSERT INTO TestIds
Update: I now have a solution for MS SQL, but I still need one for Access too.
- INSERT INTO [TestIds] DEFAULT VALUES