Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase «««1234»»

Defaults Expand / Collapse
Author
Message
Posted Thursday, November 15, 2012 8:13 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Tuesday, August 19, 2014 8:13 AM
Points: 1,409, Visits: 252
Good, easy question.
Thanks
Post #1385187
Posted Thursday, November 15, 2012 8:24 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: 2 days ago @ 4:11 PM
Points: 5,969, Visits: 8,228
Roland Alexander STL (11/15/2012)
No, I don't believe I'm confused. Have a look at the list at http://msdn.microsoft.com/en-us/library/ms143729.aspx where you'll find this entry:

Use of DEFAULT keyword as default value.
Do not use the word DEFAULT as a default value.

under "Not Supported In A Future Version of SQL Server".

Now, it may be that I misread this, but I'm hard-pressed to see how. Nonetheless I would be quite happy to be shown wrong.


It toook me a lot of digging to get to the bottom of this. But finally, I stumbled upon a Connect item filed against this specific text in Books Online, back in 2007. Link: http://connect.microsoft.com/SQLServer/feedback/details/293052/incorrect-depreaction-use-of-default-keyword-as-default-value.
Apparently, Microsoft wants to deprecate using the literal text 'DEFAULT' as a default value. Exactly why they want to do that is not clear, nor why, five years later, the wording has still not been clarified - but at least we can all heave a sigh of relief, knowing that Microsoft is not going to deprecate the ANSI-standard usage of syntax values. They are "only" going to outlaw one specific, randomly chosen value.
(By the way, when thinking about this issue I can't help wondering what will happen in localized versions of SQL Server - will the Japanese version accept the string 'DEFAULT' but produce an error on the Japanese translation of that word? This looks like a very random idea to me!)



Hugo Kornelis, SQL Server MVP
Visit my SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
Post #1385196
Posted Thursday, November 15, 2012 8:49 AM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Friday, August 22, 2014 2:00 PM
Points: 3,293, Visits: 1,976
Nice question. I had never actually used the DEFAULT keyword in an insert statement before or seen it used. I have used default constraints many times but never considered doing something like;

INSERT INTO #QOTD VALUES(1,DEFAULT) or UPDATE #QOTD SET WithDefault = DEFAULT.

Post #1385216
Posted Thursday, November 15, 2012 8:50 AM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Friday, July 25, 2014 12:09 PM
Points: 437, Visits: 334
Hugo Kornelis (11/15/2012)
Roland Alexander STL (11/15/2012)
No, I don't believe I'm confused. Have a look at the list at http://msdn.microsoft.com/en-us/library/ms143729.aspx where you'll find this entry:

Use of DEFAULT keyword as default value.
Do not use the word DEFAULT as a default value.

under "Not Supported In A Future Version of SQL Server".

Now, it may be that I misread this, but I'm hard-pressed to see how. Nonetheless I would be quite happy to be shown wrong.


It toook me a lot of digging to get to the bottom of this. But finally, I stumbled upon a Connect item filed against this specific text in Books Online, back in 2007. Link: http://connect.microsoft.com/SQLServer/feedback/details/293052/incorrect-depreaction-use-of-default-keyword-as-default-value.
Apparently, Microsoft wants to deprecate using the literal text 'DEFAULT' as a default value. Exactly why they want to do that is not clear, nor why, five years later, the wording has still not been clarified - but at least we can all heave a sigh of relief, knowing that Microsoft is not going to deprecate the ANSI-standard usage of syntax values. They are "only" going to outlaw one specific, randomly chosen value.
(By the way, when thinking about this issue I can't help wondering what will happen in localized versions of SQL Server - will the Japanese version accept the string 'DEFAULT' but produce an error on the Japanese translation of that word? This looks like a very random idea to me!)


LOL! Random is right! Thanks, Hugo, for digging into this and clearing the matter up. Much appreciated. I wonder why MS hasn't clarified the matter on the deprecation page...


Roland Alexander
The Developing World


There are two means of refuge from the miseries of life: music and cats. ~ Albert Schweitzer
Post #1385218
Posted Thursday, November 15, 2012 1:17 PM


SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: General Forum Members
Last Login: Today @ 8:31 AM
Points: 8,707, Visits: 9,255
Good basics question, nice and easy.

Interesting discussion on the deprecation of 'DEFAULT' used as a default value; I can't imagine a more lunatic restriction myself, and I see Hugo's amusing question about the Japanese version as being relevant to just about every other language which is supprted for SQL Server.


Tom
Post #1385333
Posted Thursday, November 15, 2012 1:46 PM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Friday, August 22, 2014 8:50 AM
Points: 4,425, Visits: 3,417
Thanks for an easy basics question, Ken!
Post #1385348
Posted Thursday, November 15, 2012 1:52 PM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Yesterday @ 1:55 PM
Points: 21,638, Visits: 15,305
Thanks for the question.



Jason AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server


SQL RNNR

Posting Performance Based Questions - Gail Shaw
Posting Data Etiquette - Jeff Moden
Hidden RBAR - Jeff Moden
VLFs and the Tran Log - Kimberly Tripp
Post #1385351
Posted Thursday, November 15, 2012 5:05 PM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Tuesday, December 10, 2013 4:26 PM
Points: 582, Visits: 451
Nice and easy afternoon question, here. :)

Post #1385399
Posted Friday, November 16, 2012 12:03 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 7:43 AM
Points: 13,605, Visits: 10,486
Great question, thanks Kenneth.



How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1385492
Posted Friday, November 16, 2012 12:04 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 7:43 AM
Points: 13,605, Visits: 10,486
ronmoses (11/15/2012)
Dag-nabbit, that'll teach me to read more carefully. I read it as "how many" and not "which"! Duh. Well at least I got it right in my head.

Ron


Ah, I'm not the only one
I was thinking: "why on earth are those checkboxes instead of a radio button?"




How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1385495
« Prev Topic | Next Topic »

Add to briefcase «««1234»»

Permissions Expand / Collapse