A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
Hi @NachitoMax ,
Welcome to TSQL Forum!Your question involves TSQL, so the engineer helped you add the TSQL tag.
Maybe you are not familiar with Q&A forums. Generally speaking,when you post a question, please share us a minimal example that can illustrate the problem, and your table structure (CREATE TABLE …) and some sample data(INSERT INTO …)along with your expected result. So that we’ll get a right direction and make some test.Of course, you posted relevant information in the subsequent answers.
I watched the full thread,thank you for posting the solution.It seems that null confuses you,the following instructions may be helpful to you:
To determine whether an expression is NULL, use IS NULL or IS NOT NULL instead of comparison operators (such as = or !=).
But when assigning values to variables, use comparison operators(such as = or !=).
For more details,please refer to:IS NULL (Transact-SQL)
If you have any question, please feel free to let me know.
If the response is helpful, please click "Accept Answer" and upvote it.
Regards
Echo
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Hot issues November--What can I do if my transaction log is full?
Hot issues November--How to convert Profiler trace into a SQL Server table