c# - SQL Server - How to check a row can be deleteable before deleting -



c# - SQL Server - How to check a row can be deleteable before deleting -

how can check row can delete-able before deleting row? developing new function candelete(rowid).

i have reference of tables in table of rows.

one way can catching exception. there improve way?

assuming requirement not want delete row is referenced table.

i not leave c# code. if application developed delete or access database directly.

first should set delete rule on relationship . secondarily write trigger check before deleting , handel in there. write delete statement not exist example

delete tablea id in (select id tablea left outer bring together tableb b on a.id = b.id b.id null)

c# sql-server-2012 delete-row sqlexception

Comments

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

Is there a way to convert an HTML page styled with Bootstrap CSS into email-compatible html? -