Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to write an "insert into" statement for a single column table?

Tags:

t-sql

Here's the caveat...

If you have a table that has a single column and that column happens to be an identity column with identity_insert turned OFF, is it still possible to write a T-SQL insert statement for this table?

like image 971
Senkwe Avatar asked Jan 24 '26 04:01

Senkwe


1 Answers

sure

use insert TableName default values

example

create table Test (id int identity not null)


insert Test default values

select * from Test
like image 58
SQLMenace Avatar answered Jan 26 '26 20:01

SQLMenace



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!