For example if I have following statement:
declare @uid int;
set @uid = (select id from tablename where condition)
In this case if the select returns no results, what will the value of @uid be?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
in simple words it will be null
I have made simple temporary table to test this
declared a variable
nvarchar typeand get value in this where condition is not meet then there is null and if you see by print statement then there should be nothing will be printI just insert this again to confirm that there is null