January 7, 2014 at 7:04 am
Something like this:
DECLARE @NextSeqId INT
SET @NextSeqId = dbo.FN_GetNextSeqId4CRM_MNP_ORIGINAL_NRN()
;WITH CTEseriesnacionales AS (
SELECT NextSeqId = @NextSeqId + (ROW_NUMBER() OVER(ORDER BY RangoIni)-1),
*
FROM dbo.seriesnacionales
)
MERGE dbo.CRM_MNP_ORIGINAL_NRN AS T
USING CTEseriesnacionales AS S
ON (T.RANGE1 = S.RANGOINI )
...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
January 7, 2014 at 7:33 am
Thanks Chris, it worked fine. ๐
Viewing 2 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply