For example, if I have a field with an automatic number, I add new records without specifying this field, and let the database engine select it for me.So, will he choose the number of the deleted record? If yes, when?
// SQL Server, MySQL.//
Follow-up question: What happens when the numbers for primary keys end in the database engine?
. , , ( !)
AFAIK, MySQL:
AUTO_INCREMENT InnoDB:
InnoDB . , InnoDB INSERT , .
. Innodb auto_increment.:
: innodb auto_increment .
. , , .
, , .
- , Oracle, - , .
. , . (set identity_insert on SQL Server) , , .
set identity_insert on
:
... " Oracle Sequences"
... " autonumber MySQL"
... ..
, . (IN MSSQL ), :
- , ,
CHECKIDENT DBCC ([TableName], RESEED, [NumberYouWantToStartAt])
, , ... :)
MySQL , truncate delete from where ( MySQL truncate).
truncate
delete from
where
, GUID , Guid , , Guid , , , .
MySQL id-.
- . : , ..
, ... , , , , , , , .
, , , , , , , . .
, , account_id - arghhhh!!