sql server insert into temp table 1

sql server insert into temp table

--This will create a temp table on the fly
SELECT last_name, first_name, hire_date, job_title 
INTO #tmp_employees
FROM dbo.employee
WHERE hire_date > '1/1/2010'

Here is what the above code is Doing:
1. Create a temp table called #tmp_employees
2. Select the last_name, first_name, hire_date, and job_title columns from the employee table
3. Only select rows where the hire_date is after 1/1/2010

Similar Posts