Quantcast
Channel: Forum SQL Server Database Engine
Viewing all articles
Browse latest Browse all 15889

why when assgin null value to a variable, you select the variable the value is the not null is preivous value

$
0
0

declare @var varchar(max)

set @var='1'

select @var=vars from ( select '2' as vars) ct where 1=4

select @var

the result is that "select @var equaly select 1"


Hope is a good thing.Maybe the best of things


Viewing all articles
Browse latest Browse all 15889

Trending Articles



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