script insert as
Today’s mail from https://sqlquantumleap.com/2019/05/09/maximum-number-of-rows-for-the-table-value-constructor/
Shows as way around the 1000 rows limitation on the VALUES ()… statement.
Please enhance SQL Prompts “Script as Insert” feature to use this method.
Currently SQL Prompt is scripting it like this, when the results window has more than 1000 rows:
CREATE TABLE #temptable( [id_user] int, [RowCnt] int, [mt] datetime)
INSERT INTO #temptable
VALUES
( 372, 2,N'2012-09-01T00:00:00')
INSERT INTO #temptable
VALUES
( 196, 2,N'2012-09-01T00:00:00')
INSERT INTO #temptable
VALUES
( 210, 2,N'2012-09-01T00:00:00')
…
It can be done like this:
CREATE TABLE #temptable( [iduser] int, [RowCnt] int, [mt] datetime)
INSERT INTO #temptable
select *
from(
values
( 372, 2,N'2012-09-01T00:00:00')
,( 196, 2,N'2012-09-01T00:00:00')
,( 210, 2,N'2012-09-01T00:00:00')
/* continue for more than 1000 rows */
)as a([iduser], [RowCnt], [mt])