 |
| 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
|
|
|
|

August 23rd, 2006, 03:54 AM
|
|
Authorized User
|
|
Join Date: Aug 2006
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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). 
|
|

August 24th, 2006, 02:05 AM
|
|
Friend of Wrox
|
|
Join Date: May 2006
Posts: 246
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Why just one query? Is this homework?
|
|

August 24th, 2006, 05:51 AM
|
|
Authorized User
|
|
Join Date: Aug 2006
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Well i din't get an answer to my question!!!
|
|

August 24th, 2006, 10:46 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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.
|
|

August 25th, 2006, 12:54 AM
|
|
Friend of Wrox
|
|
Join Date: May 2006
Posts: 246
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
delete FROM sysobjects
where name like 'f%' and xtype = 'u'
|
|

August 25th, 2006, 01:33 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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.
|
|

August 25th, 2006, 02:30 AM
|
|
Friend of Wrox
|
|
Join Date: May 2006
Posts: 246
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|
|

August 26th, 2006, 03:18 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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.
|
|

August 30th, 2006, 07:31 AM
|
|
Authorized User
|
|
Join Date: Aug 2006
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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....
|
|
 |