About 50 results
Open links in new tab
  1. sql - SET versus SELECT when assigning variables? - Stack Overflow

    Oct 15, 2010 · What are the differences between the SET and SELECT statements when assigning variables in T-SQL?

  2. How to set variable from a SQL query? - Stack Overflow

    1 My use case was that I wanted to set a variable to a string. All the other answers here show how to set a variable using the output of a SELECT statement. Here's how to do it with a simple string:

  3. 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 …

  4. sql - SET NOCOUNT ON usage - Stack Overflow

    Sep 27, 2009 · In TDS protocol, SET NOCOUNT ON only saves 9-bytes per query while the text "SET NOCOUNT ON" itself is a whopping 14 bytes. I used to think that 123 row(s) affected was returned …

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

    Jan 14, 2009 · How do I set a column value to NULL in SQL Server Management Studio? Asked 17 years, 2 months ago Modified 3 years, 9 months ago Viewed 1.5m times

  6. sql - Set value to NULL in MySQL - Stack Overflow

    Feb 16, 2012 · I want a value to be set to NULL if nothing is put into the text box in the form I'm submitting. How can I make this happen? I've tried inserting 'NULL' but this just adds the word NULL …

  7. SQL Statement with multiple SETs and WHEREs - Stack Overflow

    I am wondering if this is a valid query: UPDATE table SET ID = 111111259 WHERE ID = 2555 AND SET ID = 111111261 WHERE ID = 2724 AND SET ID = 111111263 WHERE ID = 2021 ...

  8. select - SQL SET statement - Stack Overflow

    Dec 21, 2015 · Your knowledge of SQL should include that it is a set-based language (pun intended) and is intended to work with an optimizer. You appear to be using SQL to write procedural code. …

  9. sql - Adding an identity to an existing column - Stack Overflow

    Jun 26, 2009 · I need to change the primary key of a table to an identity column, and there's already a number of rows in table. I've got a script to clean up the IDs to ensure they're sequential starting at 1,...

  10. sql - ALTER TABLE and SET values - Stack Overflow

    Oct 4, 2023 · The sql above first creates a temporary table and aggregates the count which is then put into table1 based on criteria of table1.id You must be careful with the size of each column.