1

In MSDN article Deprecated Database Engine Features in SQL Server 2016 there is a statement on deprecation of DEFAULT keyword (among the others).

Quoted from the table:

Category: Transact-SQL

Deprecated feature: Use of DEFAULT keyword as default value.

Replacement: Do not use the word DEFAULT as a default value.

Feature name: DEFAULT keyword as a default value.

Feature ID: 187.

What is the logic behind this change? I find nothing wrong with

CREATE FUNCTION dbo.GetFirstIdByCode(@Code nvarchar(20), @ExcludeThisId int)

and in most cases, where I don't use 2nd parameter, call it like

IF dbo.GetFirstIdByCode(@Id, DEFAULT) = 0 --- etc...

Of course, I can replace DEFAULT with NULL at every call of the function. To me, this looks like anything but a progress. Why is this planned?

How should I adjust my coding style preparing for this?

Community
  • 1
  • 1
miroxlav
  • 11,796
  • 5
  • 58
  • 99

1 Answers1

2

The wording was incorrect:Erland raised a connect item for this..please see this connect for more details..

Pasting relevant items from connect item:

Depreceated feature is ..

using the word DEFAULT as the DEFAULT value.

Example:

CREATE TABLE T1
(Col1 int PRIMARY KEY,
Status varchar(10) DEFAULT 'DEFAULT' )
or
CREATE DEFAULT phonedflt AS 'DEFAULT'
TheGameiswar
  • 27,855
  • 8
  • 56
  • 94
  • 1
    @MrLister:I *think* this was on track to deprecate from 2007 and you found it again on 2016 documentation deprecated features list – TheGameiswar Aug 21 '16 at 19:23
  • 1
    The title complained about in the connect item there is indeed the same as that here `"Use of DEFAULT keyword as default value."` - So looks like they never bothered making the documentation any clearer. Here it is on the 2008 deprecated features list too https://msdn.microsoft.com/en-us/library/ms143729(v=sql.100).aspx – Martin Smith Aug 21 '16 at 19:24