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:
01337154
Vues:
10
>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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform