Microsoft
Software
Hardware
Network
Question : stored procedure to update field with a value in another table
greetings,
I have two tables and a column in one of those tables that I would like to update.
table1 table2
col 1 = 123 col1 = 10
col 2 = null col2 = xxx_123_xxx
In this scenario, I would like table1.col2 = table2.col1 based off of table1.col1 being a substring of table2.col2.
I have a stored procedure that will give me the value of table2.col1 from a parameter that I pass in but I am not sure
If I need to do this all in stored procedure or just a single update statement and also should I use a cursor or is there
some better way to loop through the data and do an update.
Thanks in advance.
Answer : stored procedure to update field with a value in another table
UPDATE A
SET A.Col2 = B.Col1
FROM Table1 AS A
JOIN TABLE2 AS B
ON CHARIDX (A.Col1, B.Col2) > 0
Random Solutions
Is there a way to log failed logins?
Pausing a load using Loader object?
Microsoft, Windows, 2003, Event 11167 DNSAPI
Ruby string manipulation, easy enough?
iterate through timeslices
Computer suddenly has slowed to a crawl
Second email on one server
Wipe out hard drive data. Software recommendations.
Button Script not loading swf
Test if parent of an object is the main timline.