Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Remove text from varchar field
Message
From
23/06/2011 08:43:57
 
General information
Forum:
Microsoft SQL Server
Category:
Database management
Environment versions
SQL Server:
SQL Server 2000
Miscellaneous
Thread ID:
01515681
Message ID:
01515682
Views:
52
This message has been marked as the solution to the initial question of the thread.
>Hi All, I have a requirement to remove a string of text from a SS table column, the field is of type varchar(MAX) and could contain other text apart from the text I need to remove.
>
>
>
>"This is some sample text and THIS IS THE TEXT I WANT TO REMOVE this is some more random text"
>
>
>Is there a way to remove THIS IS THE TEXT I WANT TO REMOVE ?
DECLARE @test varchar(max)
SET @Test = 'This is some sample text and THIS IS THE TEXT I WANT TO REMOVE this is some more random text'
SELECT REPLACE(@Test, 'THIS IS THE TEXT I WANT TO REMOVE','')
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform