About 2,570,000 results
Open links in new tab
  1. Variables (Transact-SQL) - SQL Server | Microsoft Learn

    Nov 18, 2025 · The scope of a variable is the range of Transact-SQL statements that can reference the variable. The scope of a variable lasts from the point it's declared until the end of the batch or stored …

  2. How to Declare a Variable in SQL Server? - GeeksforGeeks

    Jul 23, 2025 · Variable declaration in SQL Server is an essential requirement to handle and process data efficiently in SQL scripts, stored procedures, and functions. Variables can be declared by using …

  3. SQL Declare Variable Code Examples - SQL Server Tips

    Oct 30, 2025 · Learn how to define and use variables in SQL Server code with these many different SQL Declare Variable code examples.

  4. SQL Variables: Basics and usage

    Nov 18, 2019 · In this article, we have explored the concept of SQL variables from different perspectives, and we also learned how to define a variable and how to assign a value (s) to it.

  5. T-SQL Variables - Declare and Set variable

    Understanding how to declare, initialize, and manipulate variables is fundamental for anyone looking to master SQL Server programming. In SQL Server, variables are used to store and manipulate data …

  6. Working with Variables and Constants in SQL Server

    Oct 7, 2023 · When working with SQL Server, it’s important to understand how to use variables and constants in your scripts. In this article, we will explore the basics of working with variables and …

    • Reviews: 1
    • How to Declare and Assign Value to a Variable in SQL Server

      May 2, 2025 · When working with SQL Server, variables play a crucial role in storing and manipulating temporary data during query execution. Understanding how to declare and assign values to variables …

    • SQL Variables: SQL Server Declare, Set and Select Variable - Guru99

      Jun 28, 2024 · Below figure explain two types of variable available in MS SQL server. A user declares the local variable. By default, a local variable starts with @. Every local variable scope has the …

    • SQL Server: Declare Variables - TechOnTheNet

      Learn how to declare variables in SQL Server (Transact-SQL) with syntax and examples. In SQL Server (Transact-SQL), a variable allows a programmer to store data temporarily during the execution of code.

    • DECLARE @local_variable (Transact-SQL) - SQL Server

      Nov 18, 2025 · Variables are declared in the body of a batch or procedure with the DECLARE statement and are assigned values by using either a SET or SELECT statement. Cursor variables can be …