Wrox Home  
Search P2P Archive for: Go

  Return to Index  

sql_language thread: Deleting Tables


Message #1 by enzaux eminem <enzaux@g...> on Fri, 14 Sep 2001 03:45:18 +0200 (MEST)
Thanks Arbon!!!   You're a blessing!!!

Enzo
----- Original Message -----
From: Arbon Reimer
To: sql language
Sent: Friday, September 14, 2001 11:33 AM
Subject: [sql_language] Re: Deleting Tables


That depends on whether or not you are actually creating a full-on table or
just one that lasts the duration of the procedure.

The SQL for deleting a table is simple:

DROP TABLE <<tablename>>

If you're using temporary tables that last the duration of a stored
procedure (HIGHLY recommended over creating a brand-new full-on table) then
they delete themselves when the procedure is over.

Such as:

CREATE TABLE #NewTempTable
(Field1 int, Field2 varchar(20))

INSERT INTO #NewTempTable
(Field1, Field2) VALUES(1,'such and such')

When the procedure is over, #NewTempTable is released.

HTH
Arbon Reimer
----- Original Message -----
From: "enzaux eminem" <enzaux@g...>
To: "sql language" <sql_language@p...>
Sent: Thursday, September 13, 2001 7:45 PM
Subject: [sql_language] Deleting Tables


> Hello!!!
>
> Im using a table as temporary storage. each looping the number of fields
> differs from the previous or current table, so to do so, i decided to
delete my
> temporary table and then create it again with new set of fields.  I would
> like to ask whether it is possible to delete tables in an SQL statement?
or what
> better ideas or technique that I should do in this issue?
>
> Thanks,
>
> Enzo

  Return to Index