{"id":2507,"date":"2021-03-16T16:30:00","date_gmt":"2021-03-16T14:30:00","guid":{"rendered":"https:\/\/www.sqlinthewild.co.za\/?p=2507"},"modified":"2021-03-18T19:44:16","modified_gmt":"2021-03-18T17:44:16","slug":"trust-but-verify","status":"publish","type":"post","link":"https:\/\/www.sqlinthewild.co.za\/index.php\/2021\/03\/16\/trust-but-verify\/","title":{"rendered":"Trust, but verify"},"content":{"rendered":"\n<p>Every year my company runs a graduate bootcamp, 2 months of teaching new grads what they need to know to write production-ready software. This post was inspired by something that happened during this year&#8217;s bootcamp.<\/p>\n\n\n\n<p>One afternoon I noticed a post in the chat channel recommending using DECIMAL over NUMERIC because &#8220;the scale in the declaration for the numeric is the exact scale, but for decimal it&#8217;s the minimum scale.&#8221; Essentially saying that NUMERIC(5,2) cannot store 1000, but DECIMAL(5,2) can. There was a link to a blog that explained that in more details. Sounds good, but there&#8217;s one problem&#8230;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.sqlinthewild.co.za\/wp-content\/uploads\/2021\/03\/2021-03-14_20-42-03.png\"><img loading=\"lazy\" decoding=\"async\" width=\"467\" height=\"287\" data-attachment-id=\"2510\" data-permalink=\"https:\/\/www.sqlinthewild.co.za\/index.php\/2021\/03\/16\/trust-but-verify\/2021-03-14_20-42-03\/\" data-orig-file=\"https:\/\/www.sqlinthewild.co.za\/wp-content\/uploads\/2021\/03\/2021-03-14_20-42-03.png\" data-orig-size=\"467,287\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"2021-03-14_20-42-03\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/www.sqlinthewild.co.za\/wp-content\/uploads\/2021\/03\/2021-03-14_20-42-03-300x184.png\" data-large-file=\"https:\/\/www.sqlinthewild.co.za\/wp-content\/uploads\/2021\/03\/2021-03-14_20-42-03.png\" src=\"https:\/\/www.sqlinthewild.co.za\/wp-content\/uploads\/2021\/03\/2021-03-14_20-42-03.png\" alt=\"\" class=\"wp-image-2510\" srcset=\"https:\/\/www.sqlinthewild.co.za\/wp-content\/uploads\/2021\/03\/2021-03-14_20-42-03.png 467w, https:\/\/www.sqlinthewild.co.za\/wp-content\/uploads\/2021\/03\/2021-03-14_20-42-03-300x184.png 300w\" sizes=\"auto, (max-width: 467px) 100vw, 467px\" \/><\/a><figcaption>Decimal vs Numeric<\/figcaption><\/figure>\n\n\n\n<p>And a quick check of the Microsoft documentation states that DECIMAL is a synonym of NUMERIC (and the error messages imply the same)<\/p>\n\n\n\n<p>Now, I&#8217;m not going to link to that blog, because a careful reading of the blog shows it to be correct in that statement, but the blog is talking about ANSI-standard SQL, not the T-SQL variant that SQL Server uses.<\/p>\n\n\n\n<p>This is a very easy mistake to make, to misread what version of a product a blog post refers to, to misread what product a blog post refers to. And that&#8217;s ignoring the very real possibility that the blog post might be incorrect. <\/p>\n\n\n\n<p>Trust what you read on people&#8217;s blogs but verify it (yes, including mine). Test out the assertions if you can, run example code, check against other blogs, check against the documentation. Just don&#8217;t assume that everything you read is correct and applies to the situation you are it. It won&#8217;t be.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Every year my company runs a graduate bootcamp, 2 months of teaching new grads what they need to know to write production-ready software. This post was inspired by something that happened during this year&#8217;s bootcamp. One afternoon I noticed a&#8230; <a class=\"read-more-button\" href=\"https:\/\/www.sqlinthewild.co.za\/index.php\/2021\/03\/16\/trust-but-verify\/\">(Read more)<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"New blog post: Trust, but verify","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[15],"tags":[],"class_list":["post-2507","post","type-post","status-publish","format-standard","hentry","category-sql-server"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p7h6n-Er","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.sqlinthewild.co.za\/index.php\/wp-json\/wp\/v2\/posts\/2507","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sqlinthewild.co.za\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sqlinthewild.co.za\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sqlinthewild.co.za\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sqlinthewild.co.za\/index.php\/wp-json\/wp\/v2\/comments?post=2507"}],"version-history":[{"count":2,"href":"https:\/\/www.sqlinthewild.co.za\/index.php\/wp-json\/wp\/v2\/posts\/2507\/revisions"}],"predecessor-version":[{"id":2517,"href":"https:\/\/www.sqlinthewild.co.za\/index.php\/wp-json\/wp\/v2\/posts\/2507\/revisions\/2517"}],"wp:attachment":[{"href":"https:\/\/www.sqlinthewild.co.za\/index.php\/wp-json\/wp\/v2\/media?parent=2507"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sqlinthewild.co.za\/index.php\/wp-json\/wp\/v2\/categories?post=2507"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sqlinthewild.co.za\/index.php\/wp-json\/wp\/v2\/tags?post=2507"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}