In my SQL Server 2008 DB, I have a table with records sort of like this:
ID 1 | Group1 | \ftp\path\group1\file1.txt
ID 2 | Group1 | C:\local\file\path\group1\file1.txt
ID 3 | Group1 | C:\local\file\path\group1\file1.txt
ID 4 | Group1 | C:\local\file\path\group1\file1.txt
ID 5 | Group2 | \ftp\path\group2\file1.txt
ID 6 | Group2 | C:\local\file\path\group2\file1.txt
ID 7 | Group2 | C:\local\file\path\group2\file1.txt
I need to update the table to look like this:
ID 1 | Group1 | \ftp\path\group1\file1.txt
ID 2 | Group1 | \ftp\path\group1\file1.txt
ID 3 | Group1 | \ftp\path\group1\file1.txt
ID 4 | Group1 | \ftp\path\group1\file1.txt
ID 5 | Group2 | \ftp\path\group2\file1.txt
ID 6 | Group2 | \ftp\path\group2\file1.txt
ID 7 | Group2 | \ftp\path\group2\file1.txt
I just don’t know how to start this. It’s easy for me to find the values in the third column, because they match this wildcard: %:\%.
So, I’m trying to replace the value in those fields that match that wildcard with the correct value in a record that does not match that wildcard. Damn, it’s so hard to explain it.
I’m probably doing a poor job of explaining this issue but the right words are eluding me at the moment.
Any ideas? I appreciate the help.
Something like this maybe?
I don’t have management studio on this machine so I’m not sure it’s syntatically correct.
Hope this helps some.