Questions tagged [identity-column]

An Identity column is a column in a database table that is made up of values managed by the server and cannot be modified, to be used as a primary key for the table. It is usually an auto-incrementing number.

Several Database products provide means to guarantee unique sequences of numeric values. Manually coding values for a primary key can cause problems.

Common database support: - Oracle: SEQUENCE (stand-alone number generator) and IDENTITY column clause that uses a system-generated SEQUENCE - mySQL: AUTO_INCREMENT column clause - Microsoft SQL Server, IBM DB2: SEQUENCE (stand-alone number generator)

See also for questions not related specifically to a primary key.

368 questions
-1
votes
1 answer

Web application throws 'Cannot INSERT null.... column does not allow NULLS

Context: Web Application (asp.net) using FormView to edit and insert pupil data into a SQL Server DB. Error: System.Data.SqlClient.SqlException: Cannot insert the value NULL into column 'txtSchoolID', table 'iSAMS.dbo.TblPupilManagementPupils';…
-1
votes
2 answers

mySQL column returns colum name insted of values

I have this problem that select returns the name of the column insted of the values in it. I have no idea what's causing that behavious. Upper table is the result i get and lower table is the whole table that i would like to get a part of. Insted…
-1
votes
1 answer

Unknown column 'AG' in 'where clause

I'm getting this error the error(title) on such a simple query: function getBranch($BranchID){ $query = "SELECT Branch FROM Branches WHERE BranchID = {$BranchID}"; $r = mysql_query($query); if (!$r) echo "Failed Query: " . mysql_error(); else…
-1
votes
1 answer

Can't INSERT INTO SELECT into a table with identity column

In SQL server, I'm using a table variable and when done manipulating it I want to insert its values into a real table that has an identity column which is also the PK. The table variable I'm making has two columns; the physical table has four, the…
Eran Goldin
  • 980
  • 12
  • 21
-2
votes
2 answers

Resetting Primary Key of Table in Server Explorer

I have deleted all my old table entries i want to reset The UserID (primary key) column of my table in Visual Studio 2010. Kindly guide how to do that.
-2
votes
2 answers

Creating a table with a column named ''PASSWORD"

Here is my script and the error I am getting. What am I doing wrong? create table PHONE_USERS ( TELEPHONE_NUMBER VARCHAR2(80) NOT NULL, PRIMARY KEY FIRST_NAME VARCHAR2(80), LAST_NAME VARCHAR2(80), KEYMAP_LASTNAME CHAR(4), "PASSWORD"…
-2
votes
1 answer

Auto Increment Always adds 1 to previous Row, Even when previous row has been dropped

Possible Duplicate: Reset AutoIncrement in SqlServer after Delete I'm having an annoying issue with an Identity auto-increment column value within an Sql Server 2008 database. When I delete a row from my table (or delete all rows), when I add a…
Daniel Lane
  • 2,575
  • 2
  • 18
  • 33
-3
votes
1 answer

in CoreData Get Specific Column Data from Table

I am using Core Data for my ios app and I am wondering how would I go about in retrieving an entire column from an entity table? For example I am sql interested in grabbing the primary key from my table.
1 2 3
24
25