Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Update syntax with Replace and Cast
Message
 
 
À
06/04/2015 16:31:03
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Versions des environnements
SQL Server:
SQL Server 2012
Application:
Web
Divers
Thread ID:
01617831
Message ID:
01617846
Vues:
19
>>What is the type of the Subject_E column in SQL Server and what is the collation of this column?
>
>Subject_ should have been Body_E and is defined Text (still not converted yet). That is why I have to cast it.

This works as well for me:
create table #test(Subject_E ntext)

insert into #test (Subject_E) values ('Testing [OldMemberTableName]'), ('Testing [OLDMEMBERTABLENAME]')

UPDATE #test SET Subject_E=replace(cast(Subject_E as nvarchar(max)) ,'[OldMemberTableName]','[Member]')
select * from #test
Both values are replaced.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform