Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to 'UPDATE' text field
Message
De
09/07/2007 15:02:35
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2000
Divers
Thread ID:
01238687
Message ID:
01238695
Vues:
6
Thanks!

So he embedded CRLFs aren't a problem?

bob

>>Can anyone tell me how you'd use the UPDATE command in T-SQL to update a memo field that had imbedded CRLF and quotes, etc. For example, if you wanted to update a text field (memo type, unlimited) with the following info:
>>
>>UPDATE mytable SET mymemofield = '
>>This is a note we wrote
>>and it's on multiple lines
>>and "fred" wrote it. '
>>WHERE key = '1234'
>>
>>
>>As you can see from the above, the note itself includes quotes (single and double) in addition to CRLF.
>>
>>What delimeter could we use so that the quotes don't mess things up, and will the embedded CRLF mess it up?
>>
>>Thanks.
>>
>>Bob
>
>Just double every single quote inside the message:
>
>UPDATE mytable SET mymemofield = '
>This is a note we wrote
>and it''s on multiple lines
>and "fred" wrote it.  '
>WHERE key = '1234'
>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform