Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Add records from one table to another
Message
 
 
À
06/07/2017 18:36:52
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
01652499
Message ID:
01652524
Vues:
44
>>BTW, the correct syntax for above INSERT will be:
>>
>>insert into Ten_name (ten_pk, user_id, user_pwrd)
>>select ten_pk, user_id, user_pwrd from Tenant x
>
>Will that work if the primary key is an auto-increment integer?

What is the goal? Insert exactly same PK or let the PK autogenerate?

In the latter case you need to remove PK column from the INSERT command fields.

In the former case see SET INDENTITY INSERT command.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform