Note that there are some explanatory texts on larger screens.

plurals
  1. USkfrosty
    primarykey
    data
    text
    plurals
    1. This table or related slice is empty.
    1. COI assume code snippets are going to be the alternative or at least a suggestion. The issue with code snippets are when I create DataMembers or MessageContractMembers, my macro's automatically calculate and populate the display order of each property. So I'm hoping there is some alternative to Macros that gives as much flexibility.
      singulars
    2. CORight now I'm thinking a viable alternative is instead of using bigint as an Identity for the Order PK fields or instead using UniqueID for OrderID in both Staging Orders & Order's for OrderID field so to my knowledge we don't have to worry about duplicates. Set the Default Value to newid(). This way if we ever have the need to write records directly to the Order table without going through Staging we can as well. FYI. We have staging because we're pulling records from legacy systems into a new system. New records go into staging to get validated before going into production tables.
      singulars
    3. COHello Andriy, I do understand Output and INTO. I found this article shortly after my original post. http://www.simple-talk.com/sql/learn-sql-server/the-merge-statement-in-sql-server-2008/ The original problem was a syntactical error trying to use the Select WHEN NOT Matched statement of my second merge trying to process the Staging OrderDetail records. I thought everything was fine. However, I just realized after there is another flaw here and it's when there are matching records in the tables. If you look at the On condition in the second merge, OD.OrderID will never equal src.OrderID.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload