Skip to content
Advertisement

SQL Is it possible to incorporate a SELECT with a REPLACE?

I’m using MS SQL Server 2019

I have a string in a table (tblJobCosts) that has its own ID like this:

How do I update the value stored in the brackets based on the value from another table?

The end result would look like this:

I thought I could incorporate a SELECT with a REPLACE but this does not seem possible:

If I run the above I receive the error:

Is it possible to incorporate a SELECT with a REPLACE?

Advertisement

Answer

I think that you cannot call a select statement in the replace function. I would try something like that:

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement