Questions tagged [identity]

Creates an identity column in a table. This property is used with the CREATE TABLE and ALTER TABLE Transact-SQL statements.

14 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
2 votes
0 answers
123 views

Is a three-way associative relationship correct in this case

So I have started modelling some entity relationships. It goes as follows: A Mandate represent a client. A row for a client (Mandate) will only appear once in the Mandate table. Each Mandate can ...
George Well's user avatar
2 votes
1 answer
326 views

Identity management in Transaction replication with updatable subscription

I have migrated my publisher DB to new server yesterday. For migration what I did was removed subscriptions and publication completely backed up DB on which publication was configured restored DB to ...
SQLPRODDBA's user avatar
  • 1,908
2 votes
0 answers
325 views

Identity in a view treated as ordinary int - migrating from SQL Server 2000 to 2012

I'm migrating a very old platform from a SQL Server 2000 backend and MS Access 2003 as its frontend to SQL Server 2012 backend and MS Access 2010 as the frontend. This obviously means a bit of ...
Mackan's user avatar
  • 181
2 votes
0 answers
875 views

SET IDENTITY_INSERT equivalent in Access

In sql server i can explicitly insert value to a identity column of a table by using SET IDENTITY_INSERT ON . For an Access database i am using Autonumber column datatype. For this column i am not ...
IT researcher's user avatar
1 vote
1 answer
30 views

PostgreSQL: How to update a identity column to fix the error "duplicate key value violates unique constraint"

I have a table with the following structure: CREATE TABLE categories ( id int GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY, name varchar NOT NULL ); When I inserted some records with an explicit ...
Jaime Suncin's user avatar
1 vote
0 answers
1k views

Postgres: with identity column as unique key, need help in upsert

Follow the below script to create two tables source_t and dest_t. drop table if exists source_t; create table source_t as (select 1 id, 'dummy1' varcol union select 3,'dummy3'); drop table if exists ...
Sajith P Shetty's user avatar
1 vote
1 answer
210 views

What is MS Access ODBC SQL syntax for a table with AutoIncrement and Memo columns?

I am migrating a full framework .NET app to core. It used ADOX to create an MS Access database and tables. It used OLE DB to populate data. In ADOX, the data type was ADOX.DataTypeEnum.adInteger and ...
Gandon Jank's user avatar
1 vote
0 answers
2k views

Transactional Replication : Issues with Identity Column in Subscriber

I have an Transactional replication set up form Server A to Server B. I have a table which has an Identity column as a primary key. In my publisher ,for the table tb1,the the identity column,Id1 was ...
user9516827's user avatar
  • 1,295
1 vote
0 answers
183 views

Identity column changing on its own?

I have a situation where a client is using software that writes to a SQL table. The program has been running fine with no issues prior to today. Today, they began receiving errors inserting NULL ...
Chris's user avatar
  • 19
1 vote
0 answers
708 views

Can I simulate a sequence in pre-2012 SQL Server, with separate identity column, in function style?

A database on SQL Server 2005/2008/R2 is currently using an identity column in a separate table as primary key source. The reason is that the application, with NHibernate as ORM, needs to know the PK ...
Erik Hart's user avatar
  • 500
0 votes
0 answers
47 views

MSSQL 2016: How do I Populate an Existing 2+ Billion Row Table with a Unique Primary key?

Is there a way to leverage the identity feature to backfill a primary key for an existing very large table? What I have done in the past is script a new table from the old table adding a new ...
plditallo's user avatar
  • 157
0 votes
1 answer
167 views

Determine Available Blocks of Contiguous Ids

We have a SQL Server table that has an int autoincrement primary key column on it. The table's primary key space is fragmented. For example, ids 1 through 10 are in use but then ids 11 through 100,000 ...
Manny Siddiqui's user avatar
0 votes
0 answers
38 views

Converting SalesForce IDs for Performance Reasons

I'm writing code for a data warehouse that extracts information from SalesForce. The format of the SalesForce IDs is like so: 001n000000UELLJAA5 Where each digit is a base-62 value denoted by: a-z ...
Alex W's user avatar
  • 121
0 votes
1 answer
30 views

Separate table creation at runtime or add column

I am planning to keep patient data in a patient table. I will have multiple Clients registered with me, and each client will have multiple doctors. Should I make patient table client wise or a single ...
Chintan Mehta's user avatar