views:

55

answers:

2

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.

+1  A: 

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.

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

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.

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