Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DROPPING A TABLE

Status
Not open for further replies.

DaRetina

Programmer
Sep 22, 2001
15
0
0
JO
Hi to All..
Thanks in Advance.
Can I DROP a table DYNAMICALLY in a trigger??
for example :
EXECUTE("DROP TABLE tablename").
Or can I call a stored procedure from within the trigger to just drop the table ?..or will the stored procedure be unable to do it because it was called form a TRIGGER?..
My problem originated from the fact that I can not DROP a TABLE explicitly from a TRIGGER..
Please I need a work around..
Thanks Again
 

1) Upgrade to SQL 2000.
2) exec master..xp_cmdshell 'osql -E -S -d<yourdb> -Q&quot;drop table table_name&quot;'
3) Start a job that drops the table

Executing a stored proc or dynamic SQL will not work as both are within the context of the Trigger. Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top