{"id":581,"date":"2013-10-17T10:31:19","date_gmt":"2013-10-17T17:31:19","guid":{"rendered":"http:\/\/www.sqldbpros.com\/?p=581"},"modified":"2014-03-03T13:40:55","modified_gmt":"2014-03-03T20:40:55","slug":"ssdt-default-values-for-smart-defaults","status":"publish","type":"post","link":"http:\/\/sqldbpros.com\/wordpress\/2013\/10\/ssdt-default-values-for-smart-defaults\/","title":{"rendered":"SSDT Default Values For Smart Defaults"},"content":{"rendered":"<p>There's a handy feature in SSDT (SQL Server Development Tools) that will automatically insert a default value into a column when you change it from nullable to NOT NULL. I wasn't able to track down documentation specifying what the default values for the \"smart defaults\" were so I hopped into the SQL DB Pros corporate jet and headed to our top secret North Pole laboratory to see what I could figure out. The results are below.<\/p>\n<p>&nbsp;<\/p>\n<h1>Default Values For SSDT Smart Defaults<\/h1>\n<p>&nbsp;<\/p>\n<table width=\"369\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<colgroup>\n<col width=\"112\" \/>\n<col width=\"257\" \/> <\/colgroup>\n<tbody>\n<tr>\n<td width=\"112\" height=\"20\">bigint<\/td>\n<td width=\"257\">0<\/td>\n<\/tr>\n<tr>\n<td height=\"20\">binary<\/td>\n<td>0x00<\/td>\n<\/tr>\n<tr>\n<td height=\"20\">bit<\/td>\n<td>0<\/td>\n<\/tr>\n<tr>\n<td height=\"20\">char<\/td>\n<td>\u00a0&lt;empty string&gt;<\/td>\n<\/tr>\n<tr>\n<td height=\"20\">date<\/td>\n<td>1900-01-01<\/td>\n<\/tr>\n<tr>\n<td height=\"20\">datetime<\/td>\n<td>1900-01-01 00:00:00.000<\/td>\n<\/tr>\n<tr>\n<td height=\"20\">datetime2<\/td>\n<td>1900-01-01 00:00:00.0000000<\/td>\n<\/tr>\n<tr>\n<td height=\"20\">datetimeoffset<\/td>\n<td>1900-01-01 00:00:00.0000000 +00:00<\/td>\n<\/tr>\n<tr>\n<td height=\"20\">decimal<\/td>\n<td>0<\/td>\n<\/tr>\n<tr>\n<td height=\"20\">float<\/td>\n<td>0<\/td>\n<\/tr>\n<tr>\n<td height=\"20\">hierarchyid<\/td>\n<td>\u00a0&lt;smart default not valid&gt;<\/td>\n<\/tr>\n<tr>\n<td height=\"20\">image<\/td>\n<td>0x<\/td>\n<\/tr>\n<tr>\n<td height=\"20\">int<\/td>\n<td>0<\/td>\n<\/tr>\n<tr>\n<td height=\"20\">money<\/td>\n<td>0.00<\/td>\n<\/tr>\n<tr>\n<td height=\"20\">nchar<\/td>\n<td>\u00a0\u00a0&lt;empty string&gt;<\/td>\n<\/tr>\n<tr>\n<td height=\"20\">ntext<\/td>\n<td>\u00a0\u00a0&lt;empty string&gt;<\/td>\n<\/tr>\n<tr>\n<td height=\"20\">numeric<\/td>\n<td>0<\/td>\n<\/tr>\n<tr>\n<td height=\"20\">nvarchar<\/td>\n<td>\u00a0\u00a0&lt;empty string&gt;<\/td>\n<\/tr>\n<tr>\n<td height=\"20\">real<\/td>\n<td>0<\/td>\n<\/tr>\n<tr>\n<td height=\"20\">smalldatetime<\/td>\n<td>1900-01-01 00:00:00<\/td>\n<\/tr>\n<tr>\n<td height=\"20\">smallint<\/td>\n<td>0<\/td>\n<\/tr>\n<tr>\n<td height=\"20\">smallmoney<\/td>\n<td>0.00<\/td>\n<\/tr>\n<tr>\n<td height=\"20\">sql_variant<\/td>\n<td>\u00a0 &lt;smart default not valid&gt;<\/td>\n<\/tr>\n<tr>\n<td height=\"20\">text<\/td>\n<td>\u00a0\u00a0&lt;empty string&gt;<\/td>\n<\/tr>\n<tr>\n<td height=\"20\">time<\/td>\n<td>00:00:00.0000000<\/td>\n<\/tr>\n<tr>\n<td height=\"20\">timestamp<\/td>\n<td>\u00a0&lt;null value not allowed&gt;<\/td>\n<\/tr>\n<tr>\n<td height=\"20\">tinyint<\/td>\n<td>0<\/td>\n<\/tr>\n<tr>\n<td height=\"20\">uniqueidentifier<\/td>\n<td>00000000-0000-0000-0000-000000000000<\/td>\n<\/tr>\n<tr>\n<td height=\"20\">varbinary<\/td>\n<td>0x<\/td>\n<\/tr>\n<tr>\n<td height=\"20\">varchar<\/td>\n<td>\u00a0\u00a0&lt;empty string&gt;<\/td>\n<\/tr>\n<tr>\n<td height=\"20\">xml<\/td>\n<td>\u00a0\u00a0&lt;empty string&gt;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n","protected":false},"excerpt":{"rendered":"<p>There's a handy feature in SSDT (SQL Server Development Tools) that will automatically insert a default value into a column when you change it from nullable to NOT NULL. I wasn't able to track down documentation specifying what the default values for the \"smart defaults\" were so I hopped into the SQL DB Pros corporate [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[122,1],"tags":[],"class_list":["post-581","post","type-post","status-publish","format-standard","hentry","category-ssdt-sql-server-data-tools","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/sqldbpros.com\/wordpress\/wp-json\/wp\/v2\/posts\/581","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/sqldbpros.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/sqldbpros.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/sqldbpros.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/sqldbpros.com\/wordpress\/wp-json\/wp\/v2\/comments?post=581"}],"version-history":[{"count":6,"href":"http:\/\/sqldbpros.com\/wordpress\/wp-json\/wp\/v2\/posts\/581\/revisions"}],"predecessor-version":[{"id":588,"href":"http:\/\/sqldbpros.com\/wordpress\/wp-json\/wp\/v2\/posts\/581\/revisions\/588"}],"wp:attachment":[{"href":"http:\/\/sqldbpros.com\/wordpress\/wp-json\/wp\/v2\/media?parent=581"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/sqldbpros.com\/wordpress\/wp-json\/wp\/v2\/categories?post=581"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/sqldbpros.com\/wordpress\/wp-json\/wp\/v2\/tags?post=581"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}