Error 2627 Ms Sql Server
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business error 2627 sql server 2008 Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs
Error Number 2627 In Sql Server
Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just
Sqlserver Error 2627
like you, helping each other. Join them; it only takes a minute: Sign up Unique Key Violation in SQL Server - Is it safe to assume Error 2627? up vote 37 down vote favorite 3 I need
Sql Server Error Code 2627
to catch violation of UNIQUE constraints in a special way by a C# application I am developing. Is it safe to assume that Error 2627 will always correspond to a violation of this kind, so that I can use if (ThisSqlException.Number == 2627) { // Handle unique constraint violation. } else { // Handle the remaing errors. } ? sql-server-2005 unique-constraint share|improve this question edited May 3 '12 at 20:37 Mark Sowul 5,9392335 asked Jun sql error 262 26 '11 at 11:47 User 1,24711932 add a comment| 3 Answers 3 active oldest votes up vote 72 down vote accepted 2627 is unique constraint (includes primary key), 2601 is unique index SELECT * FROM sys.messages WHERE text like '%duplicate%' and text like '%key%' and language_id = 1033 share|improve this answer answered Jun 26 '11 at 12:19 gbn 267k40374480 1 +1 for including the SQL –Peter H. Jul 3 '13 at 11:46 @gbn What is the difference between unique constraint and unique index? Don't both enforce indices? –student Feb 18 at 15:36 add a comment| up vote 4 down vote Here is a handy extension method I wrote to find these: public static bool IsUniqueKeyViolation(this SqlException ex) { return ex.Errors.Cast
360 games PC games sqlexception 2627 Windows games Windows phone games Entertainment All Entertainment error 2627 violation of primary key Movies & TV Music Business & Education Business Students & educators violation of primary key constraint in sql server Developers Sale Sale Find a store Gift cards Products Software & services Windows Office Free downloads & security Internet http://stackoverflow.com/questions/6483699/unique-key-violation-in-sql-server-is-it-safe-to-assume-error-2627 Explorer Microsoft Edge Skype OneNote OneDrive Microsoft Health MSN Bing Microsoft Groove Microsoft Movies & TV Devices & Xbox All Microsoft devices Microsoft Surface All Windows PCs & tablets PC accessories Xbox & games Microsoft Lumia All https://support.microsoft.com/en-us/kb/970507 Windows phones Microsoft HoloLens For business Cloud Platform Microsoft Azure Microsoft Dynamics Windows for business Office for business Skype for business Surface for business Enterprise solutions Small business solutions Find a solutions provider Volume Licensing For developers & IT pros Develop Windows apps Microsoft Azure MSDN TechNet Visual Studio For students & educators Office for students OneNote in classroom Shop PCs & tablets perfect for students Microsoft in Education Support Sign in Cart Cart Javascript is disabled Please enable javascript and refresh the page Cookies are disabled Please enable cookies and refresh the page CV: {{ getCv() }} English (United States) Terms of use Privacy & cookies Trademarks © 2016 Microsoft
360 games PC games https://support.microsoft.com/en-us/kb/323545 Windows games Windows phone games Entertainment All Entertainment Movies & TV Music Business & Education Business Students & educators Developers Sale Sale Find a store Gift cards Products Software & services Windows Office Free downloads & security Internet sql server Explorer Microsoft Edge Skype OneNote OneDrive Microsoft Health MSN Bing Microsoft Groove Microsoft Movies & TV Devices & Xbox All Microsoft devices Microsoft Surface All Windows PCs & tablets PC accessories Xbox & games Microsoft Lumia All in sql server Windows phones Microsoft HoloLens For business Cloud Platform Microsoft Azure Microsoft Dynamics Windows for business Office for business Skype for business Surface for business Enterprise solutions Small business solutions Find a solutions provider Volume Licensing For developers & IT pros Develop Windows apps Microsoft Azure MSDN TechNet Visual Studio For students & educators Office for students OneNote in classroom Shop PCs & tablets perfect for students Microsoft in Education Support Sign in Cart Cart Javascript is disabled Please enable javascript and refresh the page Cookies are disabled Please enable cookies and refresh the page CV: {{ getCv() }} English (United States) Terms of use Privacy & cookies Trademarks © 2016 Microsoft