About 51 results
Open links in new tab
  1. sql - UPDATE from a SELECT - Stack Overflow

    In SQL Server, it is possible to insert rows into a table with an INSERT.. SELECT statement: INSERT INTO Table (col1, col2, col3) SELECT col1, col2, col3 FROM other_table WHERE sql = 'cool' Is i...

  2. sql server - Update multiple columns in SQL - Stack Overflow

    Jan 31, 2012 · update table set a=t2.a,b=t2.b etc which can be pretty tiresome to write if you have 100+ columns.

  3. SQL Update from One Table to Another Based on a ID Match

    Oct 22, 2008 · Just a note on this solution, UPDATE...FROM is proprietary therefore, if you cannot use the MERGE statement because you are using SQL 2005 or earlier, this is an ANSI-compliant method …

  4. sql server - SQL UPDATE WHERE IN (List) or UPDATE each individually ...

    Oct 19, 2015 · UPDATE table1 SET somecolumn = 'someVal' WHERE ID IN (SELECT ID FROM @definedTable); In the above, @definedTable is a SQL 'User Defined Table Type', where the data …

  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, something …

  6. How to update Identity Column in SQL Server? - Stack Overflow

    Oct 3, 2013 · You can not update identity column. SQL Server does not allow to update the identity column unlike what you can do with other columns with an update statement. Although there are …

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

    This was an example, but the point is as Eric said in How can I do an UPDATE statement with JOIN in SQL Server?. You need to add an UPDATE statement at first with the full address of all tables to join …

  8. sql - Update multiple values in a single statement - Stack Overflow

    I have a master / detail table and want to update some summary values in the master table against the detail table. I know I can update them like this: update MasterTbl set TotalX = (select sum(X...

  9. SQL Server : on update set current timestamp - Stack Overflow

    update myTable set last_time =CURRENT_TIMESTAMP ; worked, but it updated all the rows instead of the current. Yeah, guess what - because that is exactly what you tell SQL Server: Update all rows in …

  10. How do I set a column value to NULL in SQL Server Management Studio?

    Jan 14, 2009 · Update myTable set MyColumn = NULL This would set the entire column to null as the Question Title asks. To set a specific row on a specific column to null use: