Quantcast
Channel: SET vs. SELECT - What's the difference? - Stack Overflow
Viewing all articles
Browse latest Browse all 6

Answer by Mitch Wheat for SET vs. SELECT - What's the difference?

$
0
0

SQL Server: one situation where you have to use SELECT is when assigning @@ERROR and @@ROWCOUNT as these have to be set in the same statement (otherwise they get reset):

SELECT @error = @@ERROR, @rowcount = @@ROWCOUNT

(SET only works with one value at a time)


Viewing all articles
Browse latest Browse all 6


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