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

Empty string and Default values

Sep 2 2008 10:21AM by Madhivanan   

Often newbies use empty string and consider it as NULL. But when an empty string is passed, it may not be stored as empty string or NULL. It actually depends on the datatype of the column. Consider this example

DECLARE @t TINYINT,@s SMALLINT,@i INT,@big BIGINT,@f FLOAT,@bit BIT, @sm SMALLMONEY,@m MONEY,@d DATETIME 
SELECT        
        @t='',
        @i='',        
        @big='',
        @f='',        
        @bit='',
        @sm='',        
        @m='',        
        @d=''
SELECT        
        @t as tinyint_col,        
        @i as int_col,
        @big as bigint_col,        
        @f as float_col,
        @bit as bit_col,        
        @sm as smallmoney_col,
        @m as money_col,        
        @d as datetime_col
 

The result is Zero for all the variables except @d which has the date value of 1900-01-01 00:00:00.000 So beware of this and always use NULL if you want NULL values stored in the column and dont use empty string

Tags: t-sql, sql_server, default,


Madhivanan
3 · 40% · 12947
2
 
0
Lifesaver
 
 
0
Learned
 
0
Incorrect



Submit

Your Comment


Sign Up or Login to post a comment.

"Empty string and Default values" rated 5 out of 5 by 2 readers
Empty string and Default values , 5.0 out of 5 based on 2 ratings
    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]