Click here to Skip to main content
11,575,635 members (61,818 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: 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.

Ex:--

Table

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
Sucharitha
Posted 2-Jan-13 1:38am
Edited 2-Jan-13 1:50am
v3
Comments
Zoltán Zörgő at 2-Jan-13 7:41am
   
How did you imagine the "every time i deleted the record" part?

1 solution

Rate this: bad
good
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
(select Isnull(max(srno),0)+1 from tbl) as srno,
'abc' as EmpName ,
'Officer' as Desig,
'Ind' as Loc
Happy Coding!
Smile | :)
  Permalink  

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

  Print Answers RSS


Advertise | Privacy | Mobile
Web03 | 2.8.150624.2 | Last Updated 2 Jan 2013
Copyright © CodeProject, 1999-2015
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