General information
Forum:
Microsoft SQL Server
>>>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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only