Local variables: the local variable is one that a user can customize, it is only within the scope of the program. Local variable names must have an @
DECLARE
@ Variable name variable type
As a way to assign values to variables in general, there are two, one is to use the SELECT statement, one is using the SET statement
Global variables: global variables are defined in advance inside the system variables sqlserver
The Notes - single-line comment
/ * Multi-line comments