Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 7129

How to Detect Unique Key Violation And Priamry Key Violation Seperately

$
0
0

i want to detect unique key violation and primary key violation separately

by using

catch(SqlException ex)

if(ex==2627)

///then some code

but this number is same for unique key and primary key

how to detect these two differently

thanks



Viewing all articles
Browse latest Browse all 7129

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>