Numerical sequence generation for automatic key creation

learn more… | top users | synonyms

4
votes
1answer
187 views

How to check with SQL whether a column is an identity column for an Access database?

Knowing how to check whether a column is an identity column for Microsoft SQL Server, I currently still found no solution for doing the same with SQL for a Microsoft Access database. My question: ...
0
votes
1answer
36 views

auto_increment incremented on non-affecting queries

When performing the following query on 'sessions': INSERT IGNORE INTO sessions (user_id, archived) VALUES (3, 0) while: CREATE TABLE `sessions` ( `id` bigint(20) unsigned NOT NULL ...
0
votes
1answer
30 views

Returning auto-generated primary key after SQL insertion

I am trying to submit data to a database and then have it return the value of the user_id (primary key) created by the insertion, but I can't get it to return the value. I use the same query in ...
2
votes
0answers
15 views

Mysql History Trigger Auto Increment bug or problem

I want to log history of a table, I created a history table and triggers for update,insert and delete operations. I do my test on realtime replication slave. When a record inserted master's main ...
0
votes
0answers
12 views

Pat_ID Incrementing by 2 only after close

I am working on an internal project connecting my database to my application. I am using C# to write the program. I am still learning and this is more of a training tool than anything else. When the ...
0
votes
0answers
30 views

Creating mysql config setting per database

I am trying to setup MySQL so one database auto increments by 2. I am using the auto_increment_increment variable in my.cnf configuration file, but this is being applied to every database. I would ...
0
votes
0answers
57 views

Different Auto-increment values Mysql schema Replication

I have 6 Slave set up (EC-2, linux) and a Master ; 2 schemas getting replicated. Version info: mysql Ver 14.14 Distrib 5.5.34, for Linux (x86_64) using readline 5.1 Once in few months in one of the ...
0
votes
0answers
77 views

How to use ID field AUTO_INCREMENT sorted by Date field?

Any ideas how I could use ID field AUTO_INCREMENT sorted by Date field? Date field consist of dates and I would like to have to ID (INT NOT NULL AUTO_INCREMENT) field ascending values from oldest to ...
0
votes
0answers
117 views

How to diagnose MariaDB crash when changing InnoDB column to AUTO_INCREMENT?

I have this table, and I'm trying to change the first column to AUTO_INCREMENT: +------------+---------------------+------+-----+---------+-------+ | Field | Type | Null | Key | ...
0
votes
0answers
53 views

MySQL on Server side PRIMARY KEY taking automatically random Id

I have problem in my database which i have uploaded in Database Version libmysql 5.1.73 In that i got problem like one PRIMARY_KEY field incrementing random values. inserted id's like 1, 2, 35, 67, ...
0
votes
0answers
349 views

Proper usage of last_insert_id() in PHP procedure

I have a problem with performing sql query from php script. The query in sql looks like this: INSERT INTO `table1` VALUES (NULL, 'Blah', 'blah', 'blah', 'blah'); SET @lastID = LAST_INSERT_ID(); ...
0
votes
0answers
114 views

Auto increment holes in primary key - any issues?

I have an application that is creating large holes in the auto incremented primary surrogate key to the table as it uses lots of INSERT ... ON DUPLICATE KEY UPDATE queries. I'm looking into changing ...
0
votes
0answers
72 views

Autoincrement by 2

I use MariaDB 5.5. It increases every auto_increment value by 2. So all my ai cols look like 1 3 5 7 9 ... Where can I change this behaviour? Or might this be a bug?