T-SQL Insert into table without having to specify every column

后端 未结 7 2498
悲&欢浪女
悲&欢浪女 2021-02-18 13:25

In our db there is a table that has a little over 80 columns. It has a primary key and Identity insert is turned on. I\'m looking for a way to insert into this table every colum

7条回答
  •  臣服心动
    2021-02-18 14:16

    CREATE TABLE Tests
    (
        TestID int IDENTITY PRIMARY KEY,
        A int,
        B int,
        C int
    )
    
    INSERT INTO dbo.Tests
    VALUES (1,2,3)
    
    SELECT * FROM Tests
    

    This works in SQL2012

提交回复
热议问题