Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AceDBA
Starting Member
13 Posts |
Posted - 2004-04-01 : 18:55:39
|
| I'm trying to truncate Table1 and I disable all the constraints on Table1 by the following command:alter table Table1 nocheck constraint allbut I still get an error message saying "Cannot truncate table 'Database..Table1' because it is being referenced by a FOREIGN KEY constraint."Any comments on how I can work around this?Thanks/ |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2004-04-01 : 18:58:06
|
| You need to drop the FK constraints from the child tables that relate to the parent table.Tara |
 |
|
|
Amethystium
Aged Yak Warrior
701 Posts |
Posted - 2004-04-02 : 05:37:18
|
| [code]DELETE Table1Where 1 = 1GO[/code]________________Make love not war! |
 |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2004-04-02 : 05:38:32
|
| or just delete Table1==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2004-04-02 : 10:27:12
|
| You need to make sure you've backed up the database firstBrett8-) |
 |
|
|
|
|
|