Numerical sequence generation for automatic key creation

learn more… | top users | synonyms

0
votes
2answers
81 views

Trick for AUTO_INCREMENT on composite keys in InnoDB

In contrast to the MySQL MyISAM-Engine, the InnoDB-Engine can not handle when one column of a composite primary key is declared as AUTO_INCREMENT. For example consider the following table: CREATE ...
4
votes
1answer
218 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: ...
2
votes
1answer
82 views

autoincrement column issue in MYSQL

We are using an autoincrement column in a temporary table, and doing multiple time inserts. The autogenerated ids are not being generated consecutive (I have attached a sample simple query: 16 is ...
0
votes
1answer
47 views

MariaDB is Forgetting Previous Auto Increment IDs

I'm using MariaDB 5.5.39, and it seems like it is forgetting the max id of the auto-incremented primary key if I delete all rows from the table and then too much time passes before another row gets ...
0
votes
1answer
43 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
33 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
38 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 ...
1
vote
0answers
27 views

can't change autoincremet variable in mariadb

I have problem with auto_increment in mariadb. I have 4 galera nodes. but my auto_increment_increment variable is 4.. Can I change dynamic? Is there any problem in big systems when I have billion or ...
1
vote
0answers
22 views

Table metadata auto_increment value for table modification

if table X is modified(DELETE, INSERT, UPDATE) then table X's metadata value should get incremented. I can write trigger for the same. But inbuilt solution will be better. This way I can stop ...
0
votes
0answers
53 views

Mariadb, Galera auto_increment_increment

I have a 3 node Galera cluster configured and as a temporary solution so I can re point a client at a time (for testing) I also have a master-master old style slave from the Galera cluster to the old ...
0
votes
0answers
13 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
54 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
121 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
62 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
478 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
136 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
77 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?