Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Remove text from varchar field
Message
General information
Forum:
Microsoft SQL Server
Category:
Database management
Environment versions
SQL Server:
SQL Server 2000
Miscellaneous
Thread ID:
01515681
Message ID:
01515683
Views:
36
>>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','')
>
Thanks Borislav, fastest answer ever ???
Regards,
Peter J. Kane



Pete
Previous
Reply
Map
View

Click here to load this message in the networking platform