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 2000 Forums
 SQL Server Development (2000)
 Foreign key

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-06-20 : 07:21:01
Yngve Øines writes "I have a couple of tables which are connected by constraints/foreign keys.

I have written a ASP-based UI for editing the tables.

Are there any easy way to check however or not the actual record is locked by dependencies to other tables/records? I need this check to enable/disable a delete-button in the asp.

Y"

Thrasymachus
Constraint Violating Yak Guru

483 Posts

Posted - 2005-06-20 : 09:51:07
Locked is not the right word here. What you want to say is wether the the record has records in another table where the 2 tables have a foriegn\primary key dependency. And based on the existence of that relationship you want enable or disable the button.

It sounds like you are going to need to run a query to check for this when your form\page loads.

Sean Roussy

Please backup all of your databases including master, msdb and model on a regular basis. I am tired of telling people they are screwed. The job you save may be your own.
Go to Top of Page
   

- Advertisement -