{"id":1816,"date":"2015-01-07T10:13:57","date_gmt":"2015-01-07T08:13:57","guid":{"rendered":"http:\/\/soci.hu\/blog\/?p=1816"},"modified":"2015-01-07T11:13:24","modified_gmt":"2015-01-07T09:13:24","slug":"sql-fejtoro-3-2","status":"publish","type":"post","link":"https:\/\/soci.hu\/blog\/index.php\/2015\/01\/07\/sql-fejtoro-3-2\/","title":{"rendered":"SQL fejt\u00f6r\u0151 3."},"content":{"rendered":"<p>Hogyan biztos\u00edtan\u00e1d egy SQL Server t\u00e1bl\u00e1ban, hogy egy oszlop csak egyedi \u00e9rt\u00e9keket tartalmazzon, de NULL-b\u00f3l b\u00e1rmennyi lehessen benne?<\/p>\n<pre class=\"brush: sql; title: ; notranslate\" title=\"\">\r\nUSE TempDB\r\nGO\r\n\r\nset ansi_nulls on;\r\ngo\r\nCREATE TABLE AlmaTabla (Oszlop1 INT NULL);\r\nGO\r\n\r\n--------------------------------------\r\n-- Ide kellene valami, amitol az alabb lathato eredmenyek szuletnek\r\n--------------------------------------\r\n\r\n--Elvart eredmeny:\r\n\r\nINSERT INTO AlmaTabla (Oszlop1) VALUES (1)\t\t--ok\r\nGO\r\nINSERT INTO AlmaTabla (Oszlop1) VALUES (2)\t\t--ok\r\nGO\r\nINSERT INTO AlmaTabla (Oszlop1) VALUES (NULL)\t--ok\r\nGO\r\nINSERT INTO AlmaTabla (Oszlop1) VALUES (NULL)\t--ok\r\nGO\r\nINSERT INTO AlmaTabla (Oszlop1) VALUES (2)\t\t--exception\r\nGO\r\n\r\nDROP TABLE AlmaTabla;\r\nGO\r\n<\/pre>\n<p>A <a href=\"http:\/\/soci.hu\/TddCourse.aspx\">Test Driven Development tanfolyam<\/a> k\u00f6vetkez\u0151 felvon\u00e1sa febru\u00e1r kilencedik\u00e9n lesz, szeretettel v\u00e1rlak.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hogyan biztos\u00edtan\u00e1d egy SQL Server t\u00e1bl\u00e1ban, hogy egy oszlop csak egyedi \u00e9rt\u00e9keket tartalmazzon, de NULL-b\u00f3l b\u00e1rmennyi lehessen benne? USE TempDB GO set&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,4,30,93],"tags":[],"class_list":["post-1816","post","type-post","status-publish","format-standard","hentry","category-adatbazisok","category-szakmai-elet","category-sql-server","category-teaser"],"_links":{"self":[{"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1816","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=1816"}],"version-history":[{"count":6,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1816\/revisions"}],"predecessor-version":[{"id":1838,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1816\/revisions\/1838"}],"wp:attachment":[{"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=1816"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=1816"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=1816"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}