Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Replacing Text
Message
De
07/01/2016 07:27:36
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
Versions des environnements
SQL Server:
SQL Server 2012
OS:
Windows 8.1
Divers
Thread ID:
01629629
Message ID:
01629632
Vues:
20
Thanks

>You have to double each single quote inside
>
>select replace(cast(insert_command as varchar(max)), '''''HQ''''', '<<Cases.Locationcode>>')
>
>
>>Hi,
>>
>>I have inherited a database with some values in a text column that I need to change to something else. The starting values are like this:
>>
>>
(''HQ'', <<IntString(Cases.ID)>>)
>>
>>I need to change this to
>>
>>
(<<Cases.LocationCode>>, <<IntString(Cases.ID)>>)
>>
>>I've tried this:
>>
>>
select replace(cast(insert_command as varchar(max)), '''HQ''', '<<Cases.Locationcode>>')
>>
>>But that leaves the single quotes in like this:
>>
>>
('<<Cases.LocationCode>>', <<IntString(Cases.ID)>>)
>>
>>What will be the correct syntax?
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform