Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

Please correct my update query

$
0
0

Hello,

Below is my query:

update [RFRL_CGN_CFQ].[CashForQuotes].CFQ_Referrals set  RecID = 
(SELECT ROW_NUMBER() OVER (ORDER BY QuoteType, QuoteDate) AS Number FROM [RFRL_CGN_CFQ].[CashForQuotes].CFQ_Referrals
where QuoteType = 'aSNAP' and QuoteDate in (getdate()))

I want to update the RecID values of all the rows (sequentially with row number), which satisfes the where condition. I am aware that while updating a column we can't give sub query which results in multiple values.

I am bit confused, please spare couple minutes of your time.

Any help is highly appreciated. Thank you.


Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>