Syntax for INSERTing into a table with no values?

前端 未结 3 1683
感情败类
感情败类 2021-01-01 08:18

I have a table created with the following schema:

CREATE TABLE [dbo].[Visualizations]
(
    VisualizationID     int identity (1,1)      NOT NULL
)

相关标签:
3条回答
  • 2021-01-01 08:46

    Trigger the identity insert with null

    insert into
                Visualizations
    values
               (null);
    
    0 讨论(0)
  • 2021-01-01 08:58

    Maybe you need to add a dummy column to do this, and just insert NULL into it, the dummy column would allow for NULLs. Although your table structure does not make sense, I would suggest this in order for it to work.

    0 讨论(0)
  • 2021-01-01 09:04

    See this (example "F. Load data using the DEFAULT VALUES option"):

    INSERT INTO [Visualizations] DEFAULT VALUES;
    
    0 讨论(0)
提交回复
热议问题