The tag has no usage guidance.

learn more… | top users | synonyms

0
votes
0answers
9 views

How to split delimited text in a column, fetch respective ID from another table and store in a new column [on hold]

I have a column i.e. p_author in sql server table named as sub_aminer_paper containing values of single or multiple authors having data type text separated by semi-colons i.e. ; Now I have to assign ...
0
votes
0answers
20 views

Compare 2 tables and display only the columns that do not match [duplicate]

I wanted to compare 2 identical tables and displat only the columns that do not match.. Suppose I have table temp A and table temp B, IF OBJECT_ID('tempdb..#A') IS NOT NULL BEGIN DROP TABLE #A END ...
1
vote
1answer
56 views

Identity column value falling behind randomly

We are having a strange intermittent issue where the identity column value falls behind the MAX(ID) for the table. Each customer gets their own table that stores statistics to the tune of ...
0
votes
0answers
46 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 ...
5
votes
1answer
216 views

Adding PRIMARY KEY and IDENTITY attributes to SQL Server 2008 tables

An application is using an SQL Server 2008 database that has ID columns, but these columns are not primary keys and have no IDENTITY attribute. What I need to do now is adding the PKs and IDENTITY ...
0
votes
1answer
83 views

Mysql Get Column Name after Case Max [closed]

i have this scenario with this query that trasform multiple rows key/values in a columns. SELECT t1.*, t2.*, u.name, u.email, u.username, MAX(CASE WHEN t2.datakey = 'latitude' THEN t2.data END) ...
-1
votes
1answer
327 views

SQL Server: performance of IDENTITY vs INT as primary key

The most important table of my database is about 300,000 records, and growing. More than 20 tables have a FK to it. Its primary key is a number, but for historical reasons is defined as nvarchar(6) ...
0
votes
2answers
493 views

How to create identity field in MySQL without using auto_increment column?

I am trying to create a dynamic system when a user can create different objects and relate them to another objects. I need is to be able to generate an identity column similar to auto_increment but ...
0
votes
1answer
15 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 ...
2
votes
1answer
4k views

Using scope_identity() to get ID “during” insertion of row?

I have a column that has an ident_current constraint on it to populate another column, like so: alter table dbo.Employee add constraint dbo_Employee_D1 default ident_current('dbo.Employee') for ...
2
votes
3answers
2k views

Identity column as clustured index bad idea?

Its just been a few months of programming in SQL Server for me so my knowledge is not good in many regards. In an already existing project at work I came across many tables with large composite ...
0
votes
1answer
107 views

Identity Column Behaviour After Replication

Say we have two Servers: Server A and Server B. Data is being replicated (vanilla Transactional Replication) from A to B. For one of the Tables, we have data as follows: Server A - Server B ...