0

I am successfully executing the following query in SQL Server 2008 built into VS2008:

SELECT REPLACE(image32, 'img', 'images/Products')
FROM Product

but when I do a select * from product query, I am given the old results. Whats going on? Why isnt my data being updated?

Did I just answer my question? Do I need to throw in an Update statement as well? If so, can you help me, my sql nerd powers are not that great yet.

0

2 Answers 2

2

Here's an example update statement:

UPDATE Product
SET image32 = replace(image32, 'img', 'images/Products')

If 'img' was a directory, better search for '/img/' and replace it with '/images/Products/'. You never know what filenames might contain img.

Sign up to request clarification or add additional context in comments.

1 Comment

Wow I still have a long way to go to becoming a SQL Query master. Many thanks.
1

Yes, you did just answer your question. You need to UPDATE if you want your data updated. Table data only gets changed when you INSERT, UPDATE, or DELETE.

1 Comment

Ok, cool. Im gonna give this a shot on my own. Thanks. BTW - You guys are super quick!! :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.