OK, check in the transact-SQL manual (books-online is a GOOD thing in
MSSQL), but this should be about right:
either:
select * from sometable into some_temp_table where 1=2
(I think this creates the table, too)
or
insert into sometable select * from othertable
something like that. I'm a bit rusty, but check in SELECT in the
Transact-SQL manual and you should be set. Dont forget you also have
sp_renametable and such usefull sp's.
Nic.
--
Nic Wise - 021.676.418 / [EMAIL PROTECTED] / Inprise/Borland New Zealand
Is it not a foolish man, said little Woo, who keeps all his chickens in his
trousers?
For at best, will he not suffocate his chickens, and, and worst, will he not
disappoint the ladies in the village? --Alexi Sayle
----- Original Message -----
From: "Derricutt, Mark" <[EMAIL PROTECTED]>
To: "Multiple recipients of list database" <[EMAIL PROTECTED]>
Sent: Monday, February 28, 2000 2:21 PM
Subject: [DUG-DB]: Creating a copy of a table/query
> As part of my porting from paradox to sql7, I need to port the code that
> creates several tempory tables, however, I'm not quite sure how to go
about
> it, initially I thought I could just do:
>
> INSERT * INTO some_temp_table FROM some_table WHERE 1 = 0
>
> Which would work, however, in same cases I need to generate this tempory
> table from the results of a query.
>
> In the original code, we pass a TDataSet to the Initialize routine which
> scans through its TFields (adding to a local TTable object) and then
calling
> TTable.CreateTable. I notice that the ADO comps have a .Clone function,
> would this be of any use to me?
>
> --
> Mark Derricutt "People in prayer for me, everyone there for me,
> ICQ: 1934853 sometimes I feel I should face this alone, my
> Wrk: 377-9941 soul exposed... it calm's me to know that I
> Fax: 377-9947 won't!" = Dream Theater - Scarred
> DDI: 375-3754
>
> Now Playing: Narnia - The Mission - Winamp
> --------------------------------------------------------------------------
-
> New Zealand Delphi Users group - Database List - [EMAIL PROTECTED]
> Website: http://www.delphi.org.nz
>
---------------------------------------------------------------------------
New Zealand Delphi Users group - Database List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz