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

  2. SQL Variables: Basics and usage

    Nov 18, 2019 · In SQL Server, local variables are used to store data during the batch execution period. The local variables can be created for different data types and can also be assigned values. …

  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. Variables (Transact-SQL) - SQL Server | Microsoft Learn

    Nov 18, 2025 · When a variable is first declared, its value is set to NULL. To assign a value to a variable, use the SET statement. This is the preferred method of assigning a value to a variable.

  5. SQL DECLARE Variable: Complete Guide | Examples in All 5 Databases

    Dec 6, 2025 · Therefore, this guide will explain everything you need to know about SQL DECLARE Variable across major databases in SQL Server, MySQL, PostgreSQL, and Oracle.

  6. A Guide To the SQL DECLARE Statement - dbvis.com

    Dec 12, 2024 · In databases like SQL Server, MySQL, PostgreSQL, and Oracle, the SQL DECLARE statement is used to define variables. SQL variables work similarly to variables in various other …

  7. How to Declare and Assign Value to a Variable in SQL Server

    May 2, 2025 · Understanding how to declare and assign values to variables is essential for writing efficient and maintainable SQL scripts. In this guide, we will explore different ways to declare and …

  8. How Do You Declare a Variable in an SQL Query?

    In Microsoft SQL Server (T-SQL), variables are declared using the `DECLARE` statement, followed by the variable name and data type. Initialization can be done immediately or later using the `SET` or …

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

  10. SQL Server: Declare Variables - TechOnTheNet

    Learn how to declare variables in SQL Server (Transact-SQL) with syntax and examples. What is a variable in SQL Server? In SQL Server (Transact-SQL), a variable allows a programmer to store …