Insert data into table where 4 fields are the same and the fifth changes I have a table with this structure:

username varchar(35)
startdate datetime
enddate datetime
saledate datetime
packageid int 


for each username there are 5 packages, so one username has 5 records in the table, and the only field that changes is packageid. Now I have been asked to insert for all the users (around 4200) another package in the table, so the statement should be like this:

insert into subscription(username,name,startdate,enddate,saledate,pkgid)
values (@username,@name,@startdate,@enddate,@saledate,41)



  41 is the value of the package field


I have included this statement in a procedure, but my problem is in how to access the username field (it logically should access a distinct(username), loop this field until there are no more users left,and in each cycle execute the procedure). The id column of the table is of no help, because the packages at the beginning were not added in group (so I cannot set the id=id+5). Any idea?
No loops are needed in this (please!).

You should be doing an INSERT...SELECT.

Always run the SELECT part of the statement on it's own first, to make sure it is only selecting what you expect to be inserted.

INSERT INTO subscription(username,name,startdate,enddate,saledate,pkgid)
SELECT DISTINCT
  username,
  name,
  startdate,
  enddate,
  saledate,
  41
FROM subscription;


If there is a specific startdate and enddate you want to use for all users, then you'll need to set them as variables.

DECLARE @startdate DATETIME;
DECLARE @enddate DATETIME;

SET @startdate = '2015-05-21 10:00:00.000';
SET @enddate = '2015-06-21 00:00:00.000';

INSERT INTO subscription(username,name,startdate,enddate,saledate,pkgid)
SELECT DISTINCT
   username,
   name,
   @startdate,
   @enddate,
   NULL,
   41
FROM subscription;