Re: Drop all user tables + ignore constraints

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Aaron [SQL Server MVP] (ten.xoc_at_dnartreb.noraa)
Date: 08/06/04


Date: Fri, 6 Aug 2004 11:02:32 -0400

Uh, how about drop database, re-create, and re-create the tables? This is
far easier to script out than dropping all those constraints and tables in
the right order.

-- 
http://www.aspfaq.com/
(Reverse address to reply.)
"dw" <cougarmana_NOSPAM@uncw.edu> wrote in message
news:uXAl1W8eEHA.2896@TK2MSFTNGP11.phx.gbl...
> Hello, all. We need to drop all user tables in a SQL Server 2K database
all
> at once with a piece of code. However, many of the tables have foreign key
> relationships, and it gives errors until we drop the constraints. Any way
to
> drop all constraints on all user tables, and then drop all user tables?
> Thanks.
>
>


Relevant Pages

  • Re: A real world example
    ... If a constraint is defined in terms of successive states of a database, ... Yes, that's all facts are, though constraints mean that your facts are ... value of a candidate key determines the values of all other attributes, ... The frame of reference for a candidate key is a ...
    (comp.databases.theory)
  • Re: A real world example
    ... If a constraint is defined in terms of successive states of a database, ... facts cannot be thought of just in terms of instances of predicates. ... Yes, that's all facts are, though constraints mean that your facts are ...
    (comp.databases.theory)
  • Re: A real world example
    ... If a constraint is defined in terms of successive states of a database, ... Yes, that's all facts are, though constraints mean that your facts are ... model already allows surrogate keys. ...
    (comp.databases.theory)
  • Re: A real world example
    ... If a constraint is defined in terms of successive states of a database, ... facts cannot be thought of just in terms of instances of predicates. ... Yes, that's all facts are, though constraints mean that your facts are ... referencing all of the attribute values, nor, given only the key value, ...
    (comp.databases.theory)
  • Re: Declarative constraints in practical terms
    ... It is a portion of one or more software applications, ... The definition of a database should be all that is required to ... Constraints are an integral ... declarative constraints: SQL declarations enforced by a DBMS engine ...
    (comp.databases.theory)