Hii Jeff
Thanks a lot, It worked!!!!!!!!!!!!!!!!!!!
Regards
Satish.
----- Original Message -----
From: "Jeff Mason" <jeffm.ma.ultranet@r...>
To: "sql language" <sql_language@p...>
Sent: Thursday, August 29, 2002 6:34 PM
Subject: [sql_language] Re: Problem in droping tables using Stored procedure
> The DROP TABLE command takes a table name as an argument; you cannot use a
> variable in this situation.
>
> The only way to drop a table dynamically is to use dynamic SQL:
>
> exec ('DROP TABLE ' + @tablename)
>
> --
> Jeff Mason Custom Apps, Inc.
> Jeff@c...
>
> -----Original Message-----
> From: Alan Reinhart [mailto:avres@c...]
> Sent: Thursday, August 29, 2002 8:03 AM
> To: sql language
> Subject: [sql_language] Re: Problem in droping tables using Stored
> procedure
>
>
> on 8/29/02 7:59 AM, Satish Kumar at satish_kumar123@h... wrote:
>
> > Hii
> >
> > I want to drop table dynamically. I have written a stored procedure for
> that
>
> [snip]
>
> > ______________________________________________
> > create procedure dynamic_droptable
> > @tablename varchar(100)
> > as
> > begin
> > drop table @tablename
>
> How about:
>
> DROP TABLE @tablename RESTRICTED | CASCADE
>
> =Alan R.
>
>
>
>
>