Temp Table Example |
Copy Code
|
---|---|
PRINT 'Test Temp Table'; CREATE TABLE #CustomersTemp ( ID int, CustomerName varchar(30), City varchar(50), State varchar(50) ); INSERT INTO #CustomersTemp (ID, CustomerName, City, State) SELECT * FROM customers WHERE state = 'florida'; declare @temprows int; set @temprows = select count(id) from #CustomersTemp; print 'Temp table contains'; print @temprows; DROP TABLE #customerstemp; |