Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why won't my query work?

Status
Not open for further replies.

kgkane

Programmer
Feb 8, 2005
7
US
SELECT * FROM table WHERE columname1 LIKE '%' + columname2 + '%'

How do I get this type of query to work?


Kevin
 
OK let me clarify a little more here. Here's essentially what I'm trying to do in MSSQL:

UPDATE Table1 SET col001 = table2.Col007 FROM Tabl1 JOIN Ntable2 ON (Where the text in table1.col002 can be found in table2.col001)

Hope this helps. Again thanks in advance for any help/suggestions.


Kevin
 
Code:
UPDATE t1
SET col001 = t2.col007
FROM tabl1 t1 JOIN ntable2 t2 ON t2.col001 LIKE '%' + t1.col002 + '%'

--James
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top