database - SQL Server, not inserting records in correct position after deleting one or more records -


I know, this is a very basic question, but I'm in the process of learning again the SQL stored processes and What happened:

I was practicing with a simple delete / dart routine when faced with: If I only enter records:

    1. Dog >

    2. Cat

    3. T-Rex

    4. Lama

All right, then I call a delete process, pass Colum_ID To recognize the record and remove it.

It is done correctly and everything is fine

Then I again call an inclusive process and this type of entry is done:

    1. Dog

    2. Cat

    5. Snake ** Now this is wrong, right? **

    4. Lama

And I delete records say 2 and 3, and call the insertion process for 2 new records, and Those terms will be "filled" and the third record will be below, where it should be.

Stored procedures are very basic: Insert

  USE [Exam] Go Set Go to ANSI_LLS Set Change Process [DBO] Go On [InsertData] @ Name varchar (50), @lastname varchar (50) Next to start op; Enter * in dbo.names (name, last_name) value (@name, last name) * Delete * dbo.names from END *  

  USE [test] Go set ANSI_NULLS Go to go to the conversion process QUOTED_IDENTIER [dbo]. [DeleteData] @id_record incorporates int initially on op op; Remove from Dbo.names where id_record = @id_record SELECT * dbo.names from END  

So, what this behavior is doing, the table is very basic, but conforms to Pkeys, tap No, index, etc.

The order to return rows from a statement is arbitrary, unless you have an 'order' Section

In practice, this order will be determined by the special implementation used by your DBMS, but you should not believe that order is stable.


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -