create table.docx
TRANSCRIPT
CREATE TABLE #ProductosResumen( idProducto int NOT NULL PRIMARY KEY, nombre varchar(75) NULL, precio smallmoney NULL);Insertando datos en la tabla temporal global.INSERT #ProductosResumen (idProducto, nombre , precio)SELECT id,nombre, precio FROM dbo.DEMO_PRODUCTOORDER BY nombre;INSERT INTO repres (numemp, oficinarep, nombrerep) SELECT numemp, oficina, nombre FROM empleados WHERE titulo = 'rep ventas'
USE AdventureWorks;GOSELECT c.FirstName, c.LastName, e.Title, a.AddressLine1, a.City, sp.Name AS [State/Province], a.PostalCodeINTO dbo.EmployeeAddressesFROM Person.Contact AS cJOIN HumanResources.Employee AS e ON e.ContactID = c.ContactIDJOIN HumanResources.EmployeeAddress AS ea ON ea.EmployeeID = e.EmployeeIDJOIN Person.Address AS a on a.AddressID = ea.AddressIDJOIN Person.StateProvince as sp ON sp.StateProvinceID = a.StateProvinceID;GO