﻿
{"id":6798,"date":"2017-08-01T06:45:05","date_gmt":"2017-08-01T06:45:05","guid":{"rendered":"http:\/\/www.gencayyildiz.com\/blog\/?p=6798"},"modified":"2017-08-01T06:45:05","modified_gmt":"2017-08-01T06:45:05","slug":"sql-server-2016-ile-datediff_big-fonksiyonu","status":"publish","type":"post","link":"https:\/\/www.gencayyildiz.com\/blog\/sql-server-2016-ile-datediff_big-fonksiyonu\/","title":{"rendered":"SQL Server 2016 \u0130le DATEDIFF_BIG Fonksiyonu"},"content":{"rendered":"<div id=\"fb-root\"><\/div>\n<p>Merhaba,<\/p>\n<p>SQL Server 2016, yap\u0131sal olarak bir\u00e7ok yenili\u011fin yan\u0131nda var olan baz\u0131 fonksiyonellikleri g\u00fc\u00e7lendirici yeni i\u015flevsellikte fonksiyonlar\u0131da beraberinde getirmi\u015ftir. Bu yordamlardan biriside DATEDIFF_BIG fonksiyonudur.<\/p>\n<p>DATEDIFF_BIG fonksiyonu, verilen iki tarih aras\u0131ndaki g\u00fcn, ay ve y\u0131l fark\u0131n\u0131 BIGINT t\u00fcr\u00fcnden hesaplamaktad\u0131r. Hat\u0131rlarsan\u0131z e\u011fer DATEDIFF fonksiyonuda ayn\u0131 i\u015flevi g\u00f6rmektedir. <em>Peki neden b\u00f6yle bir fonksiyona ihtiya\u00e7 duyulmu\u015ftur?<\/em><\/p>\n<p>DATEDIFF fonksiyonu, ald\u0131\u011f\u0131 iki tarih aras\u0131ndaki g\u00fcn, ay ve y\u0131l fark\u0131n\u0131 INT t\u00fcr\u00fcnden hesaplamaktad\u0131r. Yani bu demek oluyor ki, int t\u00fcr\u00fcnden b\u00fcy\u00fck bir \u00e7al\u0131\u015fma gerektirecek durumlarda DateDiff fonksiyonu yetersiz kalmaktad\u0131r. Ee haliyle bu a\u00e7\u0131\u011fa istinaden ihtiyaca d\u00f6n\u00fck DATEDIFF_BIG fonksiyonu mimariye eklenmi\u015ftir ve olas\u0131 int de\u011ferinden b\u00fcy\u00fck i\u015flemlerde bigint de\u011fer aral\u0131\u011f\u0131nda \u00e7al\u0131\u015fma imkan\u0131 sunmaktad\u0131r.<\/p>\n<p>Prototipi a\u015fa\u011f\u0131daki gibidir.<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nDATEDIFF_BIG(interval, starting_date, ending_date) \r\n<\/pre>\n<p>&#8220;interval&#8221; parametresi; &#8216;ms&#8217;, &#8216;Day&#8221;, &#8216;Month&#8217; ve &#8216;Year&#8217; de\u011ferleriyle beslenmektedir. &#8220;starting_date&#8221; parametresi ba\u015flang\u0131\u00e7 tarihi ve &#8220;ending_date&#8221; parametresi ise biti\u015f tarihini almaktad\u0131r.<\/p>\n<p>A\u015fa\u011f\u0131daki ekran g\u00f6r\u00fcnt\u00fcs\u00fcnden fonksiyonun kullan\u0131m\u0131n\u0131 inceleyebilirsiniz.<br \/>\n<a href=\"http:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2017\/08\/SQL-Server-2016-\u0130le-DATEDIFF_BIG-Fonksiyonu.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2017\/08\/SQL-Server-2016-\u0130le-DATEDIFF_BIG-Fonksiyonu.png\" alt=\"SQL Server 2016 \u0130le DATEDIFF_BIG Fonksiyonu\" width=\"412\" height=\"181\" class=\"aligncenter size-full wp-image-6804\" srcset=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2017\/08\/SQL-Server-2016-\u0130le-DATEDIFF_BIG-Fonksiyonu.png 412w, https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2017\/08\/SQL-Server-2016-\u0130le-DATEDIFF_BIG-Fonksiyonu-300x132.png 300w\" sizes=\"auto, (max-width: 412px) 100vw, 412px\" \/><\/a><\/p>\n<p>Son olarak;<br \/>\nint veri t\u00fcr\u00fcn\u00fcn de\u011fer aral\u0131\u011f\u0131n\u0131n &#8220;-2,147,483,648&#8221; ile &#8220;+2,147,483,647&#8221;, bigint veri t\u00fcr\u00fcn\u00fcn de\u011fer aral\u0131\u011f\u0131n\u0131n ise &#8220;-9,223,372,036,854,775,808&#8221; ile &#8220;9,223,372,036,854,775,807&#8221; aras\u0131nda oldu\u011funu bilmenizde fayda var.<\/p>\n<p>Sonraki yaz\u0131lar\u0131mda g\u00f6r\u00fc\u015fmek \u00fczere&#8230;<br \/>\n\u0130yi \u00e7al\u0131\u015fmalar&#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>Merhaba, SQL Server 2016, yap\u0131sal olarak bir\u00e7ok yenili\u011fin yan\u0131nda var olan baz\u0131 fonksiyonellikleri g\u00fc\u00e7lendirici yeni i\u015flevsellikte fonksiyonlar\u0131da beraberinde getirmi\u015ftir. Bu yordamlardan biriside DATEDIFF_BIG fonksiyonudur. DATEDIFF_BIG fonksiyonu, verilen iki tarih aras\u0131ndaki g\u00fcn, ay ve y\u0131l&#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":[1412,22],"tags":[1936,1932,1933,1413,1931,1937,1934,1935],"class_list":["post-6798","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-sql-server-2016","category-veritabani","tag-datediff-fonksiyonu","tag-datediff_big","tag-datediff_big-fonksiyonu","tag-sql-server-2016","tag-sql-server-2016-datediff_big","tag-t-sql-datediff-fonksiyonu","tag-t-sql-datediff_big","tag-t-sql-datediff_big-fonksiyonu"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/posts\/6798","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=6798"}],"version-history":[{"count":0,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/posts\/6798\/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=6798"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/categories?post=6798"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/tags?post=6798"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}