Advertisement

03.20.2008 at 03:09PM PDT, ID: 23258593
[x]
Attachment Details

Using if exists for dropping schema

Asked by yanci1179 in SQL Server 2005

I usually use the following to create objects:

IF EXISTS (SELECT name FROM sysindexes
            WHERE name = 'IX_DimDevice_1')
    DROP INDEX [IX_DimDevice_1]  ON  [MedStn].[DimDevice]
GO

I would like to do the same for shema.  What is the equivalent of the above statement to delete a schema if it exists?Start Free Trial
 
Loading Advertisement...
 
[+][-]03.20.2008 at 03:23PM PDT, ID: 21176487

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: SQL Server 2005
Sign Up Now!
Solution Provided By: l-cm
Participating Experts: 2
Solution Grade: A
 
 
[+][-]03.20.2008 at 03:24PM PDT, ID: 21176502

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.20.2008 at 04:13PM PDT, ID: 21176788

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.20.2008 at 08:31PM PDT, ID: 21177956

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.21.2008 at 04:13AM PDT, ID: 21179102

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.21.2008 at 08:27AM PDT, ID: 21180574

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628