Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Conversion problem
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Stored procedures, Triggers, UDFs
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01337038
Message ID:
01337049
Vues:
9
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))
So, it goes back to my question nobody helped me with - how can I create null byte array. I tried BitConverter.GetBytes[0], but it created 4 bytes array. I want to be able to return null array.

>>Hi everybody,
>>
>>I'm getting this error "Implicit conversion from data type nvarchar to varbinary(max) is not allowed. Use the CONVERT function to run this query."
>>
>>I pass NULL as my parameter for varbinary(max). In the stored procedure code I use ISNULL(@DefaultPicture, CONVERT(varbinary(max),''))
>>
>>What should I do to fix the problem?
>>
>>Thanks in advance.
>
>
>   ISNULL(@DefaultPicture, CONVERT(varbinary(max),0x0))
>
>
>or even:
>
>   ISNULL(@DefaultPicture, 0)
>
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform