Wrox Programmer Forums
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 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 August 23rd, 2006, 03:54 AM
Authorized User
 
Join Date: Aug 2006
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to ankur_icfai
Default Deletion..

O Hi..mates

Can any one tell how to Drop all the tables from the database starting with the same name ...say starting with 'f'(using only one query).
 
Old August 24th, 2006, 02:05 AM
Friend of Wrox
 
Join Date: May 2006
Posts: 246
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Why just one query? Is this homework?

 
Old August 24th, 2006, 05:51 AM
Authorized User
 
Join Date: Aug 2006
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to ankur_icfai
Default

Well i din't get an answer to my question!!!
 
Old August 24th, 2006, 10:46 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

You got what is called a follow-up question.

If we understand the reasoning behind your constraints (e.g. only one query can be used) we can provide better answers.

If this is a homework question, you should do some research yourself. If this is not homework, you should be able to provide more details about your questions, thus helping us help you.

If you're not willing to do that, how come you expect us to help you?

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
 
Old August 25th, 2006, 12:54 AM
Friend of Wrox
 
Join Date: May 2006
Posts: 246
Thanks: 0
Thanked 0 Times in 0 Posts
Default

delete FROM sysobjects
where name like 'f%' and xtype = 'u'


 
Old August 25th, 2006, 01:33 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Peso,

If you wanted to know whether it was homework or not, why did you provide an answer before you got his / her answer? ;)

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
 
Old August 25th, 2006, 02:30 AM
Friend of Wrox
 
Join Date: May 2006
Posts: 246
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It will take days, if at all, until he gets back. I don't expect that due to his second post.

My first thought was to write only "DELETE FROM sysobjects" to teach him a lesson. But I didn't.

 
Old August 26th, 2006, 03:18 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Quote:
quote:It will take days, if at all, until he gets back. I don't expect that due to his second post.
Exactly. That's when I usually decide not to spend time on an answer. If the OP isn't interested or willing to put some time in, why bother.....

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
 
Old August 30th, 2006, 07:31 AM
Authorized User
 
Join Date: Aug 2006
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to ankur_icfai
Default

well guys i am relly sorry...as i was busy with a lot of work...this query is not a homework man i work in a company....here we had a problem...we had many tables that start from same name and and if we want to drop them all either we have to do it one by one or go to the enterprise manager and delete some of them in one go which are in a line...so i need to know is there a query that can do the job for me....to delete all the tables starting with the same name....





Similar Threads
Thread Thread Starter Forum Replies Last Post
Folder deletion with XML Config Peroni Beginning VB 6 5 January 16th, 2008 08:11 PM
TEMP file deletion Sebastiaan VBScript 0 March 15th, 2007 09:36 AM
edit, updation and deletion in DataGrid naveed77 Beginning VB 6 0 January 12th, 2007 11:48 AM
hi please help me on xml deletion karthikc85 XML 1 October 10th, 2006 06:09 AM
File Upload and Deletion Prabhakar_dt Classic ASP Basics 4 December 23rd, 2004 07:42 AM





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