About 428,000 results
Open links in new tab
  1. How do I UPDATE from a SELECT in SQL Server? - Stack Overflow

    Feb 25, 2010 · update uno set col1=d.col1,col2=d.col2 from uno inner join dos d on uid=did where [sql]='cool' select * from uno select * from dos If the ID column name is the same in both tables …

  2. How can I do an UPDATE statement with JOIN in SQL Server?

    To perform an UPDATE statement with a JOIN in SQL Server, you can use the JOIN syntax in combination with the UPDATE statement. Here's an example query that should update the ud …

  3. Update query using Subquery in Sql Server - Stack Overflow

    Using these aliases you can easily generate UPDATE statement to update either table a or b. For table a you have an answer provided by JW. If you want to update b, the statement will be: …

  4. SQL UPDATE WHERE IN (List) or UPDATE each individually?

    Oct 19, 2015 · That said, I'm not 100% familiar with the in's and out's of SQL and how query queueing works. I'm also unsure as to which would be friendlier on the DB as far as table locks …

  5. if condition in sql server update query - Stack Overflow

    May 21, 2017 · I have a SQL server table in which there are 2 columns that I want to update either of their values according to a flag sent to the stored procedure along with the new value, …

  6. Using a conditional UPDATE statement in SQL - Stack Overflow

    May 23, 2011 · This query will update age to 15 if it’s less than 20, to 20 if it’s greater than 20, and leave age unchanged if it’s exactly 20. This method avoids the need for stored procedures and …

  7. How to update large table with millions of rows in SQL Server?

    Mar 10, 2016 · This query is supposed to update records in 5, 5 and 4 but it just updates first 5 records. Query - 1: SET ROWCOUNT 5 UPDATE TableName SET Value = 'abc1' WHERE …

  8. Update multiple tables in SQL Server using INNER JOIN

    Feb 27, 2013 · You can update with a join if you only affect one table like this: UPDATE table1 SET table1.name = table2.name FROM table1, table2 WHERE table1.id = table2.id AND …

  9. UPDATE desde un SELECT usando SQL Server

    En SQL Server, es posible hacer un INSERT INTO a una tabla usando un SELECT: INSERT INTO tabla (col, col2, col3) SELECT col, col2, col3 FROM otra_tabla WHERE sql = 'ok' ¿Es …

  10. sql - Update multiple rows using select statement - Stack Overflow

    Jun 28, 2012 · update table2 set value = (select value from table1 where table1.id = table2.id) Perhaps a better approach is a join: update table2 set value = table1.value from table1 where …