Insert multiple rows using one insert statement in Access 2010

后端 未结 8 508
醉酒成梦
醉酒成梦 2020-12-17 22:19

I want to insert multiple values into an Access 2010 table, but I can\'t seem to find a way.
MySQL had a nice way:

INSERT INTO Production.UnitMeasure
VAL         


        
8条回答
  •  甜味超标
    2020-12-17 23:18

    SQL Server definitely allows this: EDIT: [As of SQL Server 2008, thank you Marc_s]

    INSERT INTO [Table]
    ([COL1], [COL2])
    VALUES
    ('1@1.com', 1),
    ('2@2.com', 2)
    

    As for the Access requirement, I'm no access guru but I found this MSDN documentation that shows how to do multiple inserts at once.

    INSERT INTO target [(field1[, field2[, …]])] [IN externaldatabase]
         SELECT [source.]field1[, field2[, …] FROM tableexpression
    

    Doing some cursory reading beyond this, you can use a "dummy" from table if all of your values are known ahead of time as in your example.

提交回复
热议问题