Does NULL have a data type?

后端 未结 5 2101
我在风中等你
我在风中等你 2021-01-04 21:37

I ran into code similar to this today.

SELECT AuditDomain, 
    ObjectId,
    AuditSubdomain = CONVERT(VARCHAR(50), NULL),
    SubDomainObjectId = CONVERT(IN         


        
5条回答
  •  佛祖请我去吃肉
    2021-01-04 22:12

    Null has no data type. The purpose of a null is to represent an "unknown", both in value and type.

    ISNULL() returns the datatype for the first argument with a data type presented to it.

    http://msdn.microsoft.com/en-us/library/ms187928.aspx

提交回复
热议问题