About 3,810,000 results
Open links in new tab
  1. SQL Server store multiple values in sql variable - Stack Overflow

    Jul 19, 2013 · Use CTE for storing multiple values into a single variable. ;WITH DATA1 AS ( select car_name from cars where make in ('BMW', 'Toyota', 'Nissan') ) SELECT @car_name = …

  2. SQL Server SELECT INTO @Variable - GeeksforGeeks

    Feb 12, 2024 · In the world of SQL Server, the SELECT INTO statement is a powerful syntax for retrieving data from one or more tables and inserting it into a new table. However, what if you …

  3. SQL Declare Variable Code Examples - SQL Server Tips

    Dec 30, 2024 · Variables can be useful in preparing a dynamic SQL statement as they can store the table values, column names, dynamic filters, and parameters. For example, the following …

  4. Variables (Transact-SQL) - SQL Server | Microsoft Learn

    Nov 22, 2024 · A Transact-SQL local variable is an object that can hold a single data value of a specific type. Variables in batches and scripts are typically used: As a counter either to count …

  5. Passing Multiple Values into a Variable | SQL Freelancer Blog

    May 14, 2015 · Passing multiple values into a variable is a little more difficult than it should be. In other languages you can use functions such as Lists or Arrays, but SQL makes it a bit more …

  6. Variables in SQL Server Stored Procedures - SQL Server Tutorial

    To declare multiple variables, you separate variables by commas: @product_name VARCHAR (MAX); Code language: SQL (Structured Query Language) (sql) To assign a value to a …

  7. SQL SERVER – Passing multiple values through one parameter in a stored ...

    May 31, 2013 · In my earlier article, I developed a solution How to use multiple values for IN clause using same parameter (SQL Server). Recently, I received a query, inquiring how to …

  8. Setting multiple values to a variable - Spiceworks Community

    Aug 1, 2014 · How would I be able to list multiple values in place of @PT in the above statement? I would prefer to insert the values into a table variable and join to that table rather than using …

  9. sql server - Set variable with multiple values and use IN - Stack Overflow

    Sep 15, 2011 · On SQL Server 2016 or above (or Azure SQL Database), it is much simpler and more efficient, however you do have to manually apply LTRIM() to take away any leading …

  10. Storing Multiple Values in SQL Server - Axial SQL

    Learn how to store multiple values in SQL Server using a table variable. This approach allows you to store values in a structured manner, even if the count and data type are dynamic.

  11. Some results have been removed
Refresh