SQL Server Maximum rows that can be inserted in a single insert statment

前端 未结 5 441
悲哀的现实
悲哀的现实 2020-12-03 21:04

I want to do a batch insert, similar to this question

How to do a batch insert in MySQL

  1. What is the limitation is SQL Server on how many rows can b

5条回答
  •  渐次进展
    2020-12-03 21:23

    you can try this

    with tempDataTable AS (SELECT *From (VALUES
    (18001,79626,'1992-12-11','1993-12-11') -- this is data u want to insert
    )x(empNO,sal,frmDate,toDate)) -- tempDataColoumns
    INSERT INTO salaries(emp_no,salary,from_date,to_date) SELECT empNO,sal,frmDate,toDate from newData
    

    Remove '--' at the time of query

提交回复
热议问题