SQL Server: implicit data type conversions chart -


as far can tell, according this chart, implicit conversion varbinary date should ok. however, when try following code, sql server responds "implicit conversion data type varbinary(max) date not allowed. use convert function run query."

create table [dbo].[conversion_test]( [mydate] [date] null ) on [primary]  go   declare @bin varbinary(max) = null insert conversion_test values (@bin) 

i'm running on sql server 2012 (version 11.0.3128).

just found connect post:

microsoft connect

which has following statement microsoft:

posted microsoft on 05/03/2008 @ 13:23 after serious discussion, believe current design given it's not interesting scenario , support explicit conversion new date/time types.

on other hand, think it's not thing given supported many implicit conversions on existing types. conversion to/from binary dangerous thing, , requiring explicit conversion makes sense. it's unfortunate alter table behavior tied implicit conversion, can work around creating new column, issue update, , drop old column if that's main scenario worried.

so if no strong objection, we're going followings: - fixing bol indicate there's no implicit conversion support binary/varbinary new date/time types - close 'by design'

thanks

so appear decided disallow implicit conversion not update diagram.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -