1SELECT NAME, ADDRESS, PHONE
2INTO v_employee_name, v_employee_address, v_employee_phone_number
3FROM EMPLOYEE
4WHERE EMPLOYYE_ID = 6;
1USE AdventureWorks2014;
2GO
3DECLARE @MyVariable int;
4SET @MyVariable = 1;
5-- Terminate the batch by using the GO keyword.
6GO
7-- @MyVariable has gone out of scope and no longer exists.
8
9-- This SELECT statement generates a syntax error because it is
10-- no longer legal to reference @MyVariable.
11SELECT BusinessEntityID, NationalIDNumber, JobTitle
12FROM HumanResources.Employee
13WHERE BusinessEntityID = @MyVariable;
14