Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Add records from one table to another
Message
From
07/07/2017 09:39:27
 
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
01652499
Message ID:
01652549
Views:
37
>>>I have a follow up question, please. If one of the columns I want to "copy" to the target table has to be parsed, how would I do it? For example. The source table has field USER_NAME and the entry in this field is Last Name, First name. E.g. "Smith, John", "Nosonovsky, Naomi", and so on. I want to parse this field into the two fields of the Target table, FNAME and LNAME. Does SQL have SUBSTR() for that?
>>
>>Personally I strongly advise to do such things as discrete work flow steps - performance most of the times is not a limiting factor, getting result correct or clear idea what went wrong cuts down dev time. Getting everything into 1 long SQL statement sometimes is beneficial in recurring/app-used statements, but for admin tasks I think it is an anti-pattern.
>>
>>BTW: The hint on Merge(/Upsert) above instead of simple insert even on blank tables is spot on ;-)
>
>I will definitely look for a simple tutorial on the Merge command. It is just that my to-learn list is getting longer and the desire to learn is weaker :). I should qualify that I mean to learn "technical" things. Learning French is more fun :).

Personally I find "Upsert" a better name (Up(date/Insert) than merge, as it shouts out functionality and for me is better to remember ;-)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform