About 13,000,000 results
Open links in new tab
  1. 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 …

  2. 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?

  3. How do I UPDATE from a SELECT in SQL Server? - Stack Overflow

    Feb 25, 2010 · 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 …

  4. sql server - What does "+=" mean in T-SQL - Stack Overflow

    Aug 16, 2012 · The same as many other programming languages - append (or add depending on the variable's datatype, but append in this case) to the existing value. E.g. if the value of …

  5. sql - Must declare the scalar variable - Stack Overflow

    SET @sql = CONCAT(N'SELECT ', @RowTo, ' * 5'); But in your case you should use proper parameterization rather than concatenation. If you keep using concatenation, you will expose …

  6. Is it possible to set a timeout for a SQL query on Microsoft SQL …

    SQL Serve has a remote query timeout value that refers to its queries issued on over linked servers, not to queries issued by clients to it. I believe the query timeout is a client property, …

  7. How to turn IDENTITY_INSERT on and off using SQL Server 2008?

    How you were inserting a value on the identity column without realizing it isn't clear, but perhaps older versions of SQL Server would include it implicitly with all columns when explicit insert …

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

    Jan 31, 2012 · I did this in MySql and it updated multiple columns in a single record, so try this if you are using MySql as your server: "UPDATE creditor_tb SET credit_amount='" & …

  9. How to add a column with a default value to an existing table in …

    Jun 21, 2016 · ADD [Column_Name] BIT NOT NULL Default ( 0 ) Here is another way to add a column to an existing database table with a default value. A much more thorough SQL script to …

  10. sql - UPDATE and REPLACE part of a string - Stack Overflow

    Jun 28, 2013 · I've got a table with two columns, ID and Value. I want to change a part of some strings in the second column. Example of Table: ID Value ...