Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 3rd, 2006, 02:50 PM
Authorized User
 
Join Date: Nov 2005
Posts: 87
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to x_ray
Default deleting entire database

hello,

i am connecting to a database from within asp, i need to send a query in order to drop the database completely, can i do this by sending the drop command directly or should i do something else. the problem is i cannot test this now because the db is on and running, but i need to insert a script that drops the database after a while, is this possible?

 
Old April 3rd, 2006, 04:01 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

First rule - never test on a production system, always have a test environment and a production environment. (For scenarios like this)

To answer your question yes, you can send DROP TABLE [table name] directly via a query to execute the command. You could also set up a stored procedure that takes a table name as an argument and execute that as well.



"The one language all programmers understand is profanity."
 
Old April 4th, 2006, 01:28 PM
Authorized User
 
Join Date: Nov 2005
Posts: 87
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to x_ray
Default

10x dparsons, i have just done that, now i will be waiting (thanks for the tip also, although i already know it...)

 
Old April 4th, 2006, 03:02 PM
Authorized User
 
Join Date: Nov 2005
Posts: 87
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to x_ray
Default

hey dparsons, i forgot about it for a while, but the method you gave me is for deleting tables, what if i want to delete the whole database, ie drop databasename, is it possible?






Similar Threads
Thread Thread Starter Forum Replies Last Post
Deleting a row in MySQL database mattw1100 Beginning PHP 3 August 21st, 2008 05:28 PM
Help me in deleting value from database and grid [email protected] ASP.NET 1.0 and 1.1 Basics 0 December 27th, 2006 02:43 AM
get a schematic of entire database Rkohnke Access 2 July 12th, 2006 12:58 PM
Deleting data from database jaideepc ADO.NET 0 August 11th, 2004 04:04 AM
Deleting info from Database... jasmine5544 Classic ASP Databases 1 December 2nd, 2003 03:43 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.