sql - Inserting lots of rows that only have a single value change into table with lots of column -


i have table need insert 260 rows into, data same except value of single column "project". if small table write out using unin all problem there 66 total columns in table , lot of repetitive typing. there method of inserting identical info without having repeat this? if makes difference on ms sql 2008 r2 server.

assuming i'm understanding requirements correctly, perhaps work subquery building project values:

insert yourtable  select 1, 'another value', ..., t.project (select 1 project union select 2 ... select 260) t 

depending on table structure, may need supply column names.


Comments