Re: Creating temp table
From: Gregory A. Larsen (greg.larsen_at_netzero.com)
Date: 05/20/04
- Next message: Aaron Bertrand - MVP: "Re: Can error messages in Query Analyzer be suppressed?"
- Previous message: oj: "Re: Creating temp table"
- In reply to: Bret: "Creating temp table"
- Next in thread: roger: "Re: Creating temp table"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 20 May 2004 14:22:59 -0700
you might try something like this:
create procedure x as
create table #x (col1 int, col2 int)
insert into #x select col1, col2 from a
insert into #x select col1, col2 from b
insert into #x select col1, col2 from c
select * from #x
drop table #x
-- ---------------------------------------------------------------------------- ---------------------------------------------------------------------------- ---- Need SQL Server Examples check out my website at http://www.geocities.com/sqlserverexamples "Bret" <anonymous@discussions.microsoft.com> wrote in message news:FC0C05A0-BBFF-48D3-ABCD-E46081BE0C3C@microsoft.com... > Please, I want to create a stored procedure that does the following: > * Creates a temporary table > * Selects data from a table and appends to this temp table > * Selects data from a second table and appends to this temp table > * Selects data from a third table and appends to this temp table > > All 3 source tables have exact design and format.a > thank you. >
- Next message: Aaron Bertrand - MVP: "Re: Can error messages in Query Analyzer be suppressed?"
- Previous message: oj: "Re: Creating temp table"
- In reply to: Bret: "Creating temp table"
- Next in thread: roger: "Re: Creating temp table"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|