SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Defaults


Defaults

Author
Message
Lon-860191
Lon-860191
SSCommitted
SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)

Group: General Forum Members
Points: 1987 Visits: 278
Good, easy question.
Thanks
Hugo Kornelis
Hugo Kornelis
SSCoach
SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)

Group: General Forum Members
Points: 18967 Visits: 12426
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
Ken Wymore
Ken Wymore
SSCertifiable
SSCertifiable (6.6K reputation)SSCertifiable (6.6K reputation)SSCertifiable (6.6K reputation)SSCertifiable (6.6K reputation)SSCertifiable (6.6K reputation)SSCertifiable (6.6K reputation)SSCertifiable (6.6K reputation)SSCertifiable (6.6K reputation)

Group: General Forum Members
Points: 6624 Visits: 2399
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.
Roland Alexander STL
Roland Alexander STL
SSC Eights!
SSC Eights! (994 reputation)SSC Eights! (994 reputation)SSC Eights! (994 reputation)SSC Eights! (994 reputation)SSC Eights! (994 reputation)SSC Eights! (994 reputation)SSC Eights! (994 reputation)SSC Eights! (994 reputation)

Group: General Forum Members
Points: 994 Visits: 491
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
Tom Thomson
Tom Thomson
One Orange Chip
One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)One Orange Chip (26K reputation)

Group: General Forum Members
Points: 26186 Visits: 12503
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

Revenant
Revenant
SSChampion
SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)

Group: General Forum Members
Points: 12617 Visits: 5010
Thanks for an easy basics question, Ken!
SQLRNNR
SQLRNNR
SSC Guru
SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)

Group: General Forum Members
Points: 67567 Visits: 18570
Thanks for the question.



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


SQL RNNR

Posting Performance Based Questions - Gail Shaw

Olga B
Olga B
SSC Eights!
SSC Eights! (822 reputation)SSC Eights! (822 reputation)SSC Eights! (822 reputation)SSC Eights! (822 reputation)SSC Eights! (822 reputation)SSC Eights! (822 reputation)SSC Eights! (822 reputation)SSC Eights! (822 reputation)

Group: General Forum Members
Points: 822 Visits: 455
Nice and easy afternoon question, here. Smile
Koen Verbeeck
Koen Verbeeck
SSC Guru
SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)

Group: General Forum Members
Points: 63588 Visits: 13298
Great question, thanks Kenneth.


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

MCSE Business Intelligence - Microsoft Data Platform MVP
Koen Verbeeck
Koen Verbeeck
SSC Guru
SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)

Group: General Forum Members
Points: 63588 Visits: 13298
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 :-D
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?
My blog at SQLKover.

MCSE Business Intelligence - Microsoft Data Platform MVP
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search