sql - How would I copy entire rows within a table and change one value? -


insert user      (user_id, account_id, user_type_cd, name, e_mail_addr, login_failure_cnt, admin_user, primary_user) select *  pnet_user  account_id='1'; 

but want change 1 2 on inserted entries. want change 1 3 on inserted entries. want change 1 .... on inserted entries. want change 1 1000 on inserted entries.

it copy , write down 1000 times (only changing id ).

do understand ? sorry poor english ! thank !

it depends mean;

if want first 1000 users why not write;

where account_id <= 1000 

if want users;

have no where clause.

if want user inserted via parameter (user input);

declare @id int set @id = 1;  account_id = @id 

Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

java - Using an Integer ArrayList in Android -