Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 How to rearrange Records?

Author  Topic 

umapathy
Starting Member

24 Posts

Posted - 2007-08-09 : 05:48:14
Hi,

i have a table namely emp_records. the following is the structure of the table emp_records

sno int
emp_name varchar(50)
emp_code int


the example of records in the table is following

sno emp_name emp_code

1 Ramesh 1001
2 Suresh 1002
3 Ravi 1003
4 Raja 1004
5 Ramu 1005
6 Ragu 1006
7 Suni 1007
8 Madu 1008
9 Mani 1009
10 Manikam 1010

Suppose i delete the 6 th record "6 Ragu 1006". the table value should come the following

1 Ramesh 1001
2 Suresh 1002
3 Ravi 1003
4 Raja 1004
5 Ramu 1005
6 Suni 1007
7 Madu 1008
8 Mani 1009
9 Manikam 1010

if i delete any record in the table.it should automatically rearrange sno column.How can i acheive these concept.?

Regards

Umapathy



ditch
Master Smack Fu Yak Hacker

1466 Posts

Posted - 2007-08-09 : 05:57:00
You have already asked this question and got some valuable input from our members!!!!!

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=87499


Duane.
Go to Top of Page
   

- Advertisement -