J'essaye de créer une fonction d'intégration CLR dans SQL Server 2008 R2 qui lira une valeur Image/Varbinary
et retournera NVARCHAR(MAX)
.Fonction d'intégration CLR qui prendra une valeur Image/Varbinary en entrée
[Microsoft.SqlServer.Server.SqlFunction]
public static SqlString ConvertByteArrToString(SqlBinary arrByte)
Et dans SQL Server -
create function ReadAsString(@varData varbinary(max))
returns nvarchar(max)
as
external name CLRFunctions.[CLRFunctions.FormatUtilities].ConvertByteArrToString
Mais, lorsque je tente de créer au-dessus de la fonction, je reçois cette erreur:
Msg 6552, Level 16, State 3, Procedure ReadAsString, Line 1
ALTER FUNCTION for "ReadAsString" failed because T-SQL and CLR types for parameter "@varData" do not match.
Quelqu'un peut-il suggérer ce qui devrait être le bon CLR correspondre pour SQL Server Image/Varbinary(MAX)
?
http://stackoverflow.com/a/4764583/73226 –
Merci Martin! Ça a marché.. – user3927354