Click here to Skip to main content
12,299,437 members (57,034 online)
Rate this:
Please Sign up or sign in to vote.
See more: VB VB.NET
Hi All,

I want to update series number(not the primary key into a temporary table using Ms-access query.

Every time i deleted the record from that table and insert new rows.



EmpName Desig     Loc
AA      Officer   Hyd
Bb      Mgr       Ind
CC      Assoc     Us
DD      Sr.Mgr    UK

I want the table with series number

S.No  EmpName Desig     Loc
 1     AA      Officer   Hyd
 2     Bb      Mgr       Ind
 3     CC      Assoc     Us
 4     DD      Sr.Mgr    UK

Like this

Thanks in advance
Posted 2-Jan-13 1:38am
Edited 2-Jan-13 1:50am
Zoltán Zörgő 2-Jan-13 7:41am
How did you imagine the "every time i deleted the record" part?

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

create column srno with datatype int
now, while adding record in database
Insert into tbl
(select Isnull(max(srno),0)+1 from tbl) as srno,
'abc' as EmpName ,
'Officer' as Desig,
'Ind' as Loc
Happy Coding!
Smile | :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.160525.2 | Last Updated 2 Jan 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100