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
 Transact-SQL (2005)
 Constraint or trigger

Author  Topic 

Mondeo
Constraint Violating Yak Guru

287 Posts

Posted - 2007-10-04 : 11:31:48
I've got two simple tables, one contains vehicle details, one contains vehicle prices. They are linked by the primary key of the first table.

When records are deleted from table 1, the associated records in table 2 are meaningless. So i'd like to delete them automatically.

Is it better to use a constraint with the cascade delete option, or use a trigger?

Thanks

DonAtWork
Master Smack Fu Yak Hacker

2167 Posts

Posted - 2007-10-04 : 11:39:29
constraint

[Signature]For fast help, follow this link:
http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspx
Learn SQL
http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp
Go to Top of Page
   

- Advertisement -