is there any way to find out any reference of primary key value exist in Database.
Like
| Id | Country Name |
| 1 | India |
| Id | CountryId | State |
| 1 | 1 | Gujarat |
| 2 | 1 | Punjab |
now, how can i find that india is in use in state table before delete.
| Id | Country Name |
| 1 | India |
| Id | CountryId | State |
| 1 | 1 | Gujarat |
| 2 | 1 | Punjab |
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Sreekanth ReddyRank #726 · 3.2K reputationPosted Oct 31, 2018, 12:36 AM EDT
Dheeraj Sharma88 reputationPosted Oct 31, 2018, 12:36 AM EDT
Sreekanth ReddyRank #726 · 3.2K reputationPosted Oct 31, 2018, 12:43 AM EDT