SQL Server - Delete part of string [closed]
up vote
-1
down vote
favorite
I have a column in a table in the database that contains a text. This text contains multiple html parts. I need to find an exact match from a specifc string and remove it.
I've tried the REPLACE()
function, converting the text to string first but it didn't work.
Example of what I've tried:
Value is a text field that contains html. I don't have a sample as it's work related content.
Select REPLACE(CAST(Value AS VARCHAR(800)), 'bit of the string ', '')
Has anyone got any suggestions?
Cheers
sql-server string
closed as off-topic by Sami, Pearly Spencer, Machavity, Makyen, jww Nov 11 at 2:03
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See: How to create a Minimal, Complete, and Verifiable example." – Sami, Pearly Spencer, Machavity, jww
If this question can be reworded to fit the rules in the help center, please edit the question.
add a comment |
up vote
-1
down vote
favorite
I have a column in a table in the database that contains a text. This text contains multiple html parts. I need to find an exact match from a specifc string and remove it.
I've tried the REPLACE()
function, converting the text to string first but it didn't work.
Example of what I've tried:
Value is a text field that contains html. I don't have a sample as it's work related content.
Select REPLACE(CAST(Value AS VARCHAR(800)), 'bit of the string ', '')
Has anyone got any suggestions?
Cheers
sql-server string
closed as off-topic by Sami, Pearly Spencer, Machavity, Makyen, jww Nov 11 at 2:03
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See: How to create a Minimal, Complete, and Verifiable example." – Sami, Pearly Spencer, Machavity, jww
If this question can be reworded to fit the rules in the help center, please edit the question.
5
We can't see what you see, you need to post a sample data and the expected results as formatted text and what did you try too.
– Sami
Nov 10 at 21:46
Hi Sami. I've updated my question. I hope this helps. The result I got from the above is the same content in Value
– Camus
Nov 11 at 0:43
"I don't have a sample as it's work related content..." - You should probably ask a coworker instead of asking here. Stack Overflow needs to see an input, a transformation and an output. If you cannot create a contrived example that represents your problem then Stack Overflow is not going to be very useful to you.
– jww
Nov 11 at 2:05
add a comment |
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
I have a column in a table in the database that contains a text. This text contains multiple html parts. I need to find an exact match from a specifc string and remove it.
I've tried the REPLACE()
function, converting the text to string first but it didn't work.
Example of what I've tried:
Value is a text field that contains html. I don't have a sample as it's work related content.
Select REPLACE(CAST(Value AS VARCHAR(800)), 'bit of the string ', '')
Has anyone got any suggestions?
Cheers
sql-server string
I have a column in a table in the database that contains a text. This text contains multiple html parts. I need to find an exact match from a specifc string and remove it.
I've tried the REPLACE()
function, converting the text to string first but it didn't work.
Example of what I've tried:
Value is a text field that contains html. I don't have a sample as it's work related content.
Select REPLACE(CAST(Value AS VARCHAR(800)), 'bit of the string ', '')
Has anyone got any suggestions?
Cheers
sql-server string
sql-server string
edited Nov 11 at 2:03
jww
51.8k37211477
51.8k37211477
asked Nov 10 at 21:44
Camus
43011735
43011735
closed as off-topic by Sami, Pearly Spencer, Machavity, Makyen, jww Nov 11 at 2:03
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See: How to create a Minimal, Complete, and Verifiable example." – Sami, Pearly Spencer, Machavity, jww
If this question can be reworded to fit the rules in the help center, please edit the question.
closed as off-topic by Sami, Pearly Spencer, Machavity, Makyen, jww Nov 11 at 2:03
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See: How to create a Minimal, Complete, and Verifiable example." – Sami, Pearly Spencer, Machavity, jww
If this question can be reworded to fit the rules in the help center, please edit the question.
5
We can't see what you see, you need to post a sample data and the expected results as formatted text and what did you try too.
– Sami
Nov 10 at 21:46
Hi Sami. I've updated my question. I hope this helps. The result I got from the above is the same content in Value
– Camus
Nov 11 at 0:43
"I don't have a sample as it's work related content..." - You should probably ask a coworker instead of asking here. Stack Overflow needs to see an input, a transformation and an output. If you cannot create a contrived example that represents your problem then Stack Overflow is not going to be very useful to you.
– jww
Nov 11 at 2:05
add a comment |
5
We can't see what you see, you need to post a sample data and the expected results as formatted text and what did you try too.
– Sami
Nov 10 at 21:46
Hi Sami. I've updated my question. I hope this helps. The result I got from the above is the same content in Value
– Camus
Nov 11 at 0:43
"I don't have a sample as it's work related content..." - You should probably ask a coworker instead of asking here. Stack Overflow needs to see an input, a transformation and an output. If you cannot create a contrived example that represents your problem then Stack Overflow is not going to be very useful to you.
– jww
Nov 11 at 2:05
5
5
We can't see what you see, you need to post a sample data and the expected results as formatted text and what did you try too.
– Sami
Nov 10 at 21:46
We can't see what you see, you need to post a sample data and the expected results as formatted text and what did you try too.
– Sami
Nov 10 at 21:46
Hi Sami. I've updated my question. I hope this helps. The result I got from the above is the same content in Value
– Camus
Nov 11 at 0:43
Hi Sami. I've updated my question. I hope this helps. The result I got from the above is the same content in Value
– Camus
Nov 11 at 0:43
"I don't have a sample as it's work related content..." - You should probably ask a coworker instead of asking here. Stack Overflow needs to see an input, a transformation and an output. If you cannot create a contrived example that represents your problem then Stack Overflow is not going to be very useful to you.
– jww
Nov 11 at 2:05
"I don't have a sample as it's work related content..." - You should probably ask a coworker instead of asking here. Stack Overflow needs to see an input, a transformation and an output. If you cannot create a contrived example that represents your problem then Stack Overflow is not going to be very useful to you.
– jww
Nov 11 at 2:05
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
5
We can't see what you see, you need to post a sample data and the expected results as formatted text and what did you try too.
– Sami
Nov 10 at 21:46
Hi Sami. I've updated my question. I hope this helps. The result I got from the above is the same content in Value
– Camus
Nov 11 at 0:43
"I don't have a sample as it's work related content..." - You should probably ask a coworker instead of asking here. Stack Overflow needs to see an input, a transformation and an output. If you cannot create a contrived example that represents your problem then Stack Overflow is not going to be very useful to you.
– jww
Nov 11 at 2:05