Posts
1150
Comments
891
Trackbacks
1
T-SQL: Null in views

If you define a null in a view for a column (so, you always want to pass null for whatever reason), if you don't cast it, it will default to an int data type.

To get around it, do something like:

cast(isnull(columnName, 0) as varchar(8)) as columnName

posted on Monday, April 09, 2007 3:01 PM Print
Comments
No comments posted yet.

Post Comment

Title *
Name *
Email
Url
Comment *  
Please add 6 and 1 and type the answer here: