Numerical sequence generation for automatic key creation

learn more… | top users | synonyms

4
votes
1answer
238 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: ...
1
vote
1answer
23 views

MongoDB start ID and end ID

I want to insert bulk data into a MongoDB. Later on I want to find exactly the bulk I inserted. In MySQL I would have done: SELECT * FROM data WHERE id >= start_id AND id <= end_id How can ...
0
votes
1answer
64 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
45 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
34 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
24 views

Align auto increment index to next thousand

I am using MySQL. When applying a big change to a production database, I would like to change the next auto-increment index of all my tables to align them to the next available thousand. In other ...
2
votes
0answers
48 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
29 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
28 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
75 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
165 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
63 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
533 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
148 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
78 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?