Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Add records from one table to another
Message
 
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
01652499
Message ID:
01652505
Views:
42
>>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform