Generate INSERT statements from a SQL Server Table

前端 未结 2 1484
情歌与酒
情歌与酒 2021-01-21 00:29

I have a table of 3.3 million records and don\'t want to copy the entire thing from dev to prod (on a client controlled machine and can\'t get the linked server working correctl

2条回答
  •  离开以前
    2021-01-21 01:03

    insert into dev.data
    select top 300 * from prod.data where ID > 9000;
    

    or name your columns if you want to or have to (because of auto-increment columns)

    insert into dev.data (col1, col2, col3)
    select top 300 col1, col2, col3 from prod.data where ID > 9000;
    

提交回复
热议问题