Database --- variables (no effect on data in the database)
Role: The role of temporary storage data, play a cohesive role, in order to facilitate understanding of stored procedures.
Example: Declare @hello varchar (20)
Set @hello = ' Sales Department '
Select *from bumen where [email protected]
Select @hello =name from Bumen where code=1 (plus where condition)
Print @hello
Variables can also be used when placed in the middle of a select.....from , as an assignment statement, without performing a query function.
"Precautions" is simply the process of assigning a value to a variable and will not print the result
The "note" server name is equivalent to the instance name, and two versions of the database are installed and cannot be used at the same time . ( Point ) do the instance name.
1106c# base--The use of database variables, operators, if...else,while statements