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

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -