I cannot figure out how to increase the @bin I tried a cast as int and still no success. Any ideas are greatly appreciated.

DECLARE @counter int
DECLARE @bin varchar(9)
 SET @counter = 1
 Set @bin = '65R110001'
 WHILE @counter <= 5 BEGIN
insert into laitem (ViitemName,viitemdesc,vilastused,vidateadded,virevisiondate,active,entitycode,manufactureddate, stopid,statusid, itemtypeid) 
	values (@bin,@bin,getdate(),getdate(),getdate(),'1','31',getdate(),'26436EDB-D884-DD11-9BCC-0014221E87F0','91B65C02-B084-DD11-9BCC-0014221E87F0','4AF64F2F-AC84-DD11-9BCC-0014221E87F0')
     SET @counter = @counter + 1
	set @bin = @bin + 1
 END

you can't increment a string by a number directly as you have tried.

try this way

1. separate the number from string.
2. increment the number as desired.
3. concatenate back with the string.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.