About 14,600,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. 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 …

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

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

  7. Assign result of dynamic sql to variable - Stack Overflow

    You can use sp_executesql with output parameter. declare @S nvarchar(max) = 'select @x = 1' declare @xx int set @xx = 0 exec sp_executesql @S, N'@x int out', @xx out select @xx …

  8. sql - How to set multiple values inside an if else statement? - Stack ...

    Mar 29, 2016 · I'm trying to SET more than one value within the if else statement below, If I set one value it works, but if I set two values, it doesn't work: DECLARE @test1 varchar(60); …

  9. Set a DateTime database field to "Now" - Stack Overflow

    Dec 20, 2010 · In VB.net code, I create requests with SQL parameters. It I set a DateTime parameter to the value DateTime.Now, what will my request look like ? UPDATE table SET …

  10. How to declare variable and use it in the same Oracle SQL script ...

    Is it possible to concatenate variables+strings? @Ecropolis - yes, in SQL Plus use period by default. Use SET CONCAT to define the character that separates the name of a substitution …