I have a table with a single INT type column that's auto incrementing. is there a way to insert new values in that column using t-sql.
If i have a table like the following:
CREATE TABLE [dbo].[Menu](
[MNUId] [int] IDENTITY(1,1) NOT NULL,
[MNUName] [nvarchar](250))
I can insert like so:
INSERT INTO [Menu] (MNUName) VALUES ('menu name');
The above will automatically increment MNUId because its auto-increment is on.
but what if there is no MNUName column and I only have the MNUId colmn? What's the t-sql statement to insert into such a table?
Thanks,
INSERT INTO Menu DEFAULT VALUES
See the MSDN docs, DEFAULT VALUES
section.
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