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.

 All Forums
 SQL Server 2005 Forums
 SSIS and Import/Export (2005)
 Remove / Set Constraints

Author  Topic 

srinivas.alwala
Starting Member

30 Posts

Posted - 2008-06-11 : 03:35:13
Hi,

There is a master table having a relationship with 3 other tables.

1. Master Table
2. Table 1
3. Table 2
4. Table 3

Table 1 has a foriegn key having a relationp with Master table which has a primary key.

Table 2 has a primary key having a relationp with master table which has a foriegn key.

Table 3 has a primary key having a relationp with master table which has a foriegn key.

Now, there is a prevention of deleteting / truncating data in master table bcoz of having a relationp.

The requirement is to truncate data in master table removing constraints temporarily and set the constraints as it exists after the data deleted.

Pls suggest a suitable solution on this.

Regards,

Srinivas Alwala


RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2008-06-11 : 03:47:20
Is this homework?

The question is, do you really want to truncate the table or do you just want to delete from it? If delete, then just cascade your delete or write your delete in the correct order, if trucate then script out the constraints, drop them, do your truncate and then replace them.
Go to Top of Page
   

- Advertisement -