autoincrement

C# DataTable: Add new row throws error using AutoInc field

I have a collection List<Employee> employees; I use a DataTable, and load all the records (from MDB table) when Form1.Loads, and add these records to the List (Collection) so I work with them in memory. Now, when I add a new employee to the collection, I should add it also to the mdb table... so I do: DataRow rowemployee = Program...

mysql auto increment filling the 'holes'

Hi guys, I've read some posts about this issue but none cover this issue. I guess its not possible, but i'll ask anyway. I have a table with more then 50.000 registers. It's an old table where various insert/delete operations have taken place. That said, there are various 'holes' some of about 300 registers. I.e.: ..., 1340, 1341, 16...

getting the autoincremnt value after inserting record using SQL Server

Hi Guys I'm developing a project using VB.NET connected to SQL Server database and in this project i need to get the value of column called "ID" after inserting a record to the database immediately. thanx. ...

SQL Alchemy default value function for simulating autoincrement within a unique group of parent-child records

I have a small problem that I think should be easily handled by SQL Alchemy but I can't seem to get it right. I have two tables with one being a parent table and the other a child table. For each child record it needs a unique ID but only with the context of the unique parent record. I am using the Declarative Base approach. I setup ...

PHP MYSQL - Insert into without using column names but with autoincrement field

Hi guys, I've to insert a long form with 32 fields into a mysql table. i'd like to do that something like this: $sql="insert into tblname values (... 32 fields ...)"; Obviosly it works fine if the fiedls were in the same order as the mysql table fields. But, my table has as first field an id (auto-increment). What i want to avoid i...

SQL INSERT INTO returning autoincrement field.

I'm a long time desktop app C++ programmer new to SQL. I need to insert into a table with an autoincrment field, and have that sql statement return the new value for the autoincrement field. Something LIKE: INSERT INTO Entrys ('Name','Description') VALUES ('abc','xyz') SELECT Entrys.EntryID WHERE EntryID=[THE ONE JUST INSERTED!] Sor...

MySQL Cardinality vs Auto-Increment Counter

Is the MySQL cardinality number related to the auto-increment counter? ...

Simple Question regarding autoincrement operator in Java

Hi, I know that from C/C++, autoincrement operator has a different meaning depending on where it is applied (eg: integer = i++ vs. integer = ++i). In Java do the following two statements mean the same thing? int i = 1 driverVO.setUid(String.valueOf(i++)); //1? driverVO.setUid(String.valueOf(++i)); //2? ...

How to retrieve the last autoincremented ID from a SQLite table?

I have a table Messages with columns ID (primary key, autoincrement) and Content (text). I have a table Users with columns username (primary key, text) and Hash. A message is sent by one Sender (user) to many recipients (user) and a recipient (user) can have many messages. I created a table Messages_Recipients with two columns: MessageID...

Changing SharePoint form library auto increment manually

Hi all, is it possible to manually increase the autoincrement of ID column to another number in a SharePoint forms library? I need to do it once. Thx in advance. ...

Saving auto increment in MySQL

Hello, I am trying to sync between 2 tables: I have active table where has auto_increment, and I have archive table with the same values. I would like both ID's to be unique (between the tables as well) - I mean, I would like to save auto incremenet, and if I UNION both table I still have uniqness. How can I do that? Is there a possibili...

PHP Mysqli inserting a row to a table with auto_increment column

Im working on a table that has 4 columns and the first one is an auto incrementing integer called id. If im going to insert into this table using mysqli prepared statements I keep having trouble inserting a query that works. Using PHPmyAdmin It tells me to give it NULL. Ive tried this: $query = "INSERT INTO tbl (id, col2, col3, col4) V...

How To Disable Subsonic's Primary Key Autoincrement?

Hi everybody, I'm using Subsonic (simplerepository) and SQLite, and I have a class with an Int64 property marked as [SubSonicPrimaryKey]: [SubSonicPrimaryKey] public Int64 MyID; which is transformed into: [MyID] integer NOT NULL PRIMARY KEY AUTOINCREMENT Is it possible to disable the AUTOINCREMENT feature? ...

Autoincrementing hierarchical IDs on SQL Server

Consider this table on SQL Server wordID aliasID value =========================== 0 0 'cat' 1 0 'dog' 2 0 'argh' 2 1 'ugh' WordID is a id of a word which possibly has aliases. AliasID determines a specific alias to a word. So above 'argh' and 'ugh' are aliases...

Synchronising tables across remote Access databases

Hi folks, I'm helping out a business by providing an Access DB to manage requests of various types. As they are a construction company, they have one machine in an 'office' on the building site, plus 3 based in their main office. The machine on site has no internet connectivity. Is there any (reasonably simple) way to synchronise the o...

SharePoint - Auto-increment dates in new records?

Hello, I have a list that's going to be updated with relatively static data weekly, and I wanted to create a workflow to do this automatically. The only field I'm having trouble with is Start Date. I want the new Start Date to be exactly one week after the previous week's (row's) Start Date, but I can't figure out how to capture this. ...

regenerate the ID row in a MySQL Table with a Mysql's Script or PHP

Hello, i have a database fill with information of the users who use my webpage. The table as many MySql tables have the ID parameters who is autoincrement. The issue is that when somebody eliminate his account from the site, in the database remain a jump in the sequence that i dont want cuz i have a script who fail if find some jump in t...

What could be the Consequence of inserting "id" in any autoincrementing 'id' containing table?

What could be the Consequence of inserting "id" in any autoincrementing 'id' containing table? If I have a Tabe in which I have configured the column "id" as the auto incrmented, But still I am using an INSERT query in which id is defined, like wise INSERT INTO XYZ (id) values ('26'); How does it going to effect the table and the proce...

Generating incremental numeric column values during INSERT SELECT statement

I need to copy some data from one table to another in Oracle, while generating incremental values for a numeric column in the new table. This is a once-only exercise with a trivial number of rows (100). I have an adequate solution to this problem but I'm curious to know if there is a more elegant way. I'm doing it with a temporary seq...

asp.net mvc linq sql problem

Hi all, I am working on a project using asp.net mvc 2 and linq to sql. The problem occurs when trying to insert data into a table where the table has an identity column type of tinyint. When trying to insert the following error occurs: The primary key column of type 'TinyInt' cannot be generated by the server. Does linq to sql suppor...