Click to See Complete Forum and Search --> : Autoadjusting columns in SQL


Ishasofia
March 22nd, 2007, 07:12 AM
Is there any possibility to insert a column (say SL NO.) in an SQL database, which adjusts itself, even if one row in between is deleted.

For example if the row containing 2 in column SL NO. is deleted, then the cell with 3 will become 2, 4 changes to 3 and so on.

TheCPUWizard
March 22nd, 2007, 07:37 AM
You would have to write a stored procedure to accomplish this.

btw: Most professional applications use stored procedures exclusively for all data access for a variety of reasons (e.g. security, performance, maintainability)