Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using CONVERT() function
Message
De
08/02/2019 07:42:51
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Stored procedures, Triggers, UDFs
Divers
Thread ID:
01666022
Message ID:
01666095
Vues:
40
>I don't know. It is just when I set the value in the XML (again using my own serializer) and then (in the SQL Server SP) I try to get the value back, I get the error. It appears that the code in the SQL Server SP expects the separators. Why?, I don't know.

Your code:
SELECT @TargetDate = [Fld FldName].value('.','char(10)') ...
forces the result to be 10 characters wide, with no separators, there are 2 spaces trailers that would cause an exception. Simply use varchar(10) instead of char(10). If time might be included then that would be more than 10 or shifting would cause first character to be included, prefer something like varchar(20).
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform