Getting Started with Adobe After Effects - Part 6: Motion Blur


Upload Image Close it
Select File

Browse by Tags · View All
sql_server 217
t-sql 211
tsql 116
sqlserver 96
BRH 78
#SQLServer 66
#TSQL 56
SQL Server 34
function 11
SSMS 9

Archive · View All
August 2007 17
August 2010 8
June 2012 7
June 2011 7
November 2007 7
August 2012 6
May 2012 6
November 2011 6
August 2011 6
October 2011 6

Madhivanan's TSQL Blog

Default datatype of NULL

Oct 24 2011 2:03AM by Madhivanan   

As you know NULL is the absence of data and any datatype can be NULL. But by default a NULL value is considered to be of INT datatype. Let us run the following code

select null as t into #t
GO
exec tempdb..sp_help #t

A NULL value is copied to a temporary table #t. Second resultset of sp_help of #t shows that the column t is of INT datatype. As NULL is not explicitely converted to any datatype, by default SQL Server treats it as INT datatype. So you need to be aware of this. If you want it to be specific datatype, you need to explicitely convert it to different datatype as shown in the below code

select cast(null as datetime) as t into #t1
GO
exec tempdb..sp_help #t1

Tags: t-sql, sql_server, null, sqlserver, tsql, SQL Server, data_type, #SQL SERVER,


Madhivanan
3 · 40% · 12958
9
 
0
Lifesaver
 
 
 
0
Incorrect



Submit

5  Comments  

  • It's a very nice article to know NULL, a bit more. Thanks for the post sir.

    commented on Oct 28 2011 9:58AM
    Suvendu Shekhar Giri
    171 · 1% · 289
  • That's really interesting! Thank-you for the post, Madhivanan!

    commented on Nov 4 2011 4:58AM
    Nakul Vachhrajani
    4 · 36% · 11645
  • Interesting. Thanks for sharing.

    commented on Nov 7 2011 12:56AM
    Hardik Doshi
    20 · 9% · 2864
  • Found this article , to display null values at the end of the sorted table instead of first

    order by case when column_name is null then 1 else 0 end

    commented on Dec 5 2011 12:18PM
    logeswari
    375 · 0% · 108
  • Interesting! Thanks for sharing!

    commented on Feb 29 2012 4:45AM
    Nilesh
    1256 · 0% · 20

Your Comment


Sign Up or Login to post a comment.

"Default datatype of NULL" rated 5 out of 5 by 9 readers
Default datatype of NULL , 5.0 out of 5 based on 9 ratings
    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]