why is CONVERT string to VARBINARY in SQL Server only converting first character?
问题 I am using NLog to log in my application and as part of that we are logging the customer number, which is a string in C#, and a varbinary(32) in the database. I am using the following SQL code for this specific parameter. The rest of the SQL statement works fine: CONVERT(varbinary(32), @CustNumber) and the following NLog parameter: <parameter name="@CustNumber" layout="${event-context:item=CustNumber}" /> and the following code in C# to add the Nlog parameter: myEvent.Properties.Add(