Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Conversion problem
Message
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01337038
Message ID:
01337154
Views:
11
>Here is how I can re-produce the problem
>
>declare @DefaultPicture nvarchar(max)
>set @DefaultPicture = null
>create table #test (Def varbinary(max) null)
>set @DefaultPicture = convert(varbinary(max),@DefaultPicture)
>insert into #test values (ISNULL(@DefaultPicture,0))
That is wrong.
First you declare @DefaultPicture as NVARCHAR and then you assign VARBINARY value to it.
declare @DefaultPicture VARBINARY(max)

set @DefaultPicture = null
create table #test (Def varbinary(max) null)
set @DefaultPicture = convert(varbinary(max),@DefaultPicture)

insert into #test values (ISNULL(@DefaultPicture,0))
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform