Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using CONVERT() function
Message
From
08/02/2019 07:42:51
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Miscellaneous
Thread ID:
01666022
Message ID:
01666095
Views:
39
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform