Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Add records from one table to another
Message
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
01652499
Message ID:
01652505
Vues:
43
>>Merge is bullet-proof command, so you can run it multiple times. INSERT SQL will work as well once, but you can not run it the second time. So, if you're using SQL 2008 and up I suggest to forget about INSERT-SQL and UPDATE commands and always use MERGE command. The syntax will take a bit of time to get familiar with, but you will be better protected using this command.
>>
>>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
>
>Thank you. Then, in your syntax the 'x' after Tenant is not really necessary, right?

Right, for single table it is not necessary. It helps with intellisense, though. E.g. if you add x at the end you can type x. and the column name will come up.
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