By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,574 Members | 1,968 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,574 IT Pros & Developers. It's quick & easy.

How to join update statement with select?

P: 1
Dear Sir/Madam

I want to use the output of update statement in the select statement. But I couldn't.

My query is

select Table1.*, x.seqno
from Table1
cross join
(UPDATE z_addin_counter
SET seqno = seqno + 1
OUTPUT INSERTED.seqno ) x


Is there any possibility to join update with select?

With Thanks
Ksamy.
Aug 21 '09 #1
Share this Question
Share on Google+
1 Reply


ck9663
Expert 2.5K+
P: 2,878
You can direct the resultset from OUTPUT clause into a variable or temp table.

Happy coding!!

-- CK
Aug 22 '09 #2

Post your reply

Sign in to post your reply or Sign up for a free account.