Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Converting carriage returns into script
Message
De
12/09/2008 14:28:04
 
 
À
12/09/2008 14:23:29
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Scripting
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01347178
Message ID:
01347181
Vues:
18
>I have a script that contains a line to insert data into the table. In one of those fields, I have a long text which insert carriage returns. When I generate the script, this wraps on several lines. And, when being run, it will generate an error. I need to adjust the script generation to take care of those carriage returns. I would assume I would have to do something like this:
>
>
>'First part of the string' + MyCarriageReturnValue+ 'Second part of the string'
>
>
>What is the best way to do this?

use REPLACE () function:
SELECT REPLACE(SomeField, CHAR(13)+CHAR(10),MyCarriageReturnValue) AS SomeField
FROM YourTable
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform