Re: DROP A LIST OF TABLES

From: Hari (hari_prasad_k_at_hotmail.com)
Date: 05/28/04


Date: Fri, 28 May 2004 10:53:00 +0530

Hi,

Use the below script:-

declare @tbl_names varchar(300)
set @tbl_names='t1,t2,t3,t4'
exec('drop table '+@tbl_names)

Thanks
Hari
MCDBA

"Hicham Mechmachi" <mechmachi@hotmail.com> wrote in message
news:OyUPKOEREHA.556@TK2MSFTNGP10.phx.gbl...
> How can I declare table name as variale and use it in this script.
>
> Drop table Txx
> where xx is my variable.
>
> Thanks
>
>
>
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!



Relevant Pages

  • Re: DROP A LIST OF TABLES
    ... How can I declare table name as variale and use it in this script. ... Drop table Txx ...
    (microsoft.public.sqlserver.mseq)
  • Re: Compare IP addresses
    ... You cannot type variables when you declare them, ... > but the script didnt like that - that was the reason for setting the ... startoctet and endoctet werent declared either? ... >>> How do I compare two numbers in script? ...
    (microsoft.public.scripting.wsh)
  • cron script hangs after a while (seems to)
    ... these scripts from my package, ... Create an html page from the log created by the previous script. ... declare ip_src_table ...
    (comp.unix.shell)
  • Re: I thought this would be easy - HELP
    ... below tries to create variables via slice method take information from ... selected options and use the info in functions which calucate values. ... Here you declare a local variable total but also want access to a ... the script with: ...
    (comp.lang.javascript)
  • RE: variable declaration, was RE: moving to the next line
    ... Declare them as you go. ... When taking programming classes in college, ... Several people on this list have discouraged the habit. ... their script before opening their text editor. ...
    (perl.beginners)