﻿
{"id":3622,"date":"2016-03-02T00:00:22","date_gmt":"2016-03-02T00:00:22","guid":{"rendered":"http:\/\/www.gencayyildiz.com\/blog\/?p=3622"},"modified":"2016-03-02T00:00:23","modified_gmt":"2016-03-02T00:00:23","slug":"t-sqlde-unique-constraint-uygularken-alinan-olasi-hata-ve-cozumu","status":"publish","type":"post","link":"https:\/\/www.gencayyildiz.com\/blog\/t-sqlde-unique-constraint-uygularken-alinan-olasi-hata-ve-cozumu\/","title":{"rendered":"T-SQL&#8217;de Unique Constraint Uygularken Al\u0131nan Olas\u0131 Hata ve \u00c7\u00f6z\u00fcm\u00fc"},"content":{"rendered":"<div id=\"fb-root\"><\/div>\n<p>T-SQL&#8217;de Unique Constraint&#8217;in nas\u0131l uyguland\u0131\u011f\u0131n\u0131 <a href=\"http:\/\/www.gencayyildiz.com\/blog\/transact-sql-constraintlerkisitlayicilar\/\" target=\"_blank\">Transact Sql-Constraintler(K\u0131s\u0131tlay\u0131c\u0131lar)<\/a> ba\u015fl\u0131kl\u0131 yaz\u0131mda irdelemi\u015ftik. Bu g\u00fcnlerde bu k\u0131s\u0131tlay\u0131c\u0131 \u00fczerine bir \u00e7al\u0131\u015fma ger\u00e7ekle\u015ftirirken a\u015fa\u011f\u0131daki olas\u0131 hatayla kar\u015f\u0131la\u015ft\u0131m.<\/p>\n<p style=\"text-align: center;\"><em><strong>&#8220;Msg 1919, Level 16, State 1, Line 2<\/strong><\/em><br \/>\n<em><strong>Column &#8216;xxx&#8217; in table &#8216;xxx&#8217; is of a type that is invalid for use as a key column in an index.<\/strong><\/em><br \/>\n<em><strong>Msg 1750, Level 16, State 0, Line 2<\/strong><\/em><br \/>\n<em><strong>Could not create constraint or index. See previous errors.&#8221;<\/strong><\/em><\/p>\n<p style=\"text-align: left;\">Ald\u0131\u011f\u0131m hatan\u0131n g\u00f6rsel mesaj\u0131n\u0131da a\u015fa\u011f\u0131dan g\u00f6rebilirsiniz.<\/p>\n<div id=\"attachment_3623\" style=\"width: 765px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.gencayyildiz.com\/blog\/t-sqlde-unique-constraint-uygularken-alinan-olasi-hata-ve-cozumu\/t-sqlde-unique-constraint-uygularken-alinan-olasi-hata-ve-cozumu\/\" rel=\"attachment wp-att-3623\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-3623\" class=\"size-full wp-image-3623\" src=\"http:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2016\/03\/T-SQLde-Unique-Constraint-Uygularken-Al\u0131nan-Olas\u0131-Hata-ve-\u00c7\u00f6z\u00fcm\u00fc.png\" alt=\"T-SQL'de Unique Constraint Uygularken Al\u0131nan Olas\u0131 Hata ve \u00c7\u00f6z\u00fcm\u00fc\" width=\"755\" height=\"124\" srcset=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2016\/03\/T-SQLde-Unique-Constraint-Uygularken-Al\u0131nan-Olas\u0131-Hata-ve-\u00c7\u00f6z\u00fcm\u00fc.png 755w, https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2016\/03\/T-SQLde-Unique-Constraint-Uygularken-Al\u0131nan-Olas\u0131-Hata-ve-\u00c7\u00f6z\u00fcm\u00fc-300x49.png 300w\" sizes=\"auto, (max-width: 755px) 100vw, 755px\" \/><\/a><p id=\"caption-attachment-3623\" class=\"wp-caption-text\">T-SQL&#8217;de Unique Constraint Uygularken Al\u0131nan Olas\u0131 Hata ve \u00c7\u00f6z\u00fcm\u00fc<\/p><\/div>\n<p>Bu bir olas\u0131 hatad\u0131r. \u00c7\u00fcnk\u00fc belirli bir kritere g\u00f6re Unique Constraint&#8217;i uygulaman\u0131z gerekti\u011fi \u00fczere al\u0131nan bir hatad\u0131r.<\/p>\n<p>O kriter ise, Unique Constraint&#8217;i uygulayaca\u011f\u0131n\u0131z kolon nvarchar \u00f6zelli\u011finde ise maksimum 900 karakter geni\u015fli\u011finde olmal\u0131d\u0131r. Yani kolonun tipi nvarchar(MAX) veyahut nvarchar(901) olursa bu hatayla kar\u015f\u0131la\u015fman\u0131z muhtemeldir.<\/p>\n<p>Yap\u0131lan gerekli d\u00fczenlemeden sonra Unique Constraint&#8217;i sorunsuz bir \u015fekilde uygulayabilirsiniz.<\/p>\n<p>Constraint&#8217;i uygulad\u0131ktan sonrada sistem bize a\u015fa\u011f\u0131daki uyar\u0131y\u0131 vermektedir.<\/p>\n<p style=\"text-align: center;\"><em><strong>&#8220;Warning! The maximum key length is 900 bytes. The index &#8216;csUnique&#8217; has maximum length of 1800 bytes. For some combination of large values, the insert\/update operation will fail.&#8221;<\/strong><\/em><\/p>\n<p style=\"text-align: left;\">Bu uyar\u0131da, bu yaz\u0131n\u0131n i\u00e7eri\u011fini \u00f6zetlemektedir.<\/p>\n<p style=\"text-align: left;\">Hepinize iyi \u00e7al\u0131\u015fmalar dilerim&#8230;<\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>T-SQL&#8217;de Unique Constraint&#8217;in nas\u0131l uyguland\u0131\u011f\u0131n\u0131 Transact Sql-Constraintler(K\u0131s\u0131tlay\u0131c\u0131lar) ba\u015fl\u0131kl\u0131 yaz\u0131mda irdelemi\u015ftik. Bu g\u00fcnlerde bu k\u0131s\u0131tlay\u0131c\u0131 \u00fczerine bir \u00e7al\u0131\u015fma ger\u00e7ekle\u015ftirirken a\u015fa\u011f\u0131daki olas\u0131 hatayla kar\u015f\u0131la\u015ft\u0131m. &#8220;Msg 1919, Level 16, State 1, Line 2 Column &#8216;xxx&#8217; in table&#46;&#46;&#46;<!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":1,"featured_media":3415,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22],"tags":[110,909,461,907,908,85,114,906],"class_list":["post-3622","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-veritabani","tag-constraint","tag-kisitlayicilar","tag-t-sql","tag-tekil","tag-tekil-kisitlayici","tag-transact-sql","tag-unique","tag-unique-constraint"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/posts\/3622","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/comments?post=3622"}],"version-history":[{"count":0,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/posts\/3622\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/media\/3415"}],"wp:attachment":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/media?parent=3622"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/categories?post=3622"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/tags?post=3622"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}