About 629,000 results
Open links in new tab
  1. AvoidConstants” in T-SQL - Matthew McGiffen Data

    Jun 14, 2023 · Unlike some other languages, T-SQL doesn’t have the concept of a constant. As good coders, we’ve all at some point tried to use a SQL variable to hold a constant value …

  2. Constants (Transact-SQL) - SQL Server | Microsoft Learn

    Note The term constant in application development and the concept of a constant in Transact-SQL (T-SQL) aren't the same. There's no specific way to set a global static value in T-SQL. …

  3. sql server - Is there a way to make a TSQL variable constant ...

    8 There is no built-in support for constants in T-SQL. You could use SQLMenace's approach to simulate it (though you can never be sure whether someone else has overwritten the function …

  4. SQL: The need for constants in T-SQL - The Bit Bucket

    Aug 14, 2025 · SQL: The need for constants in T-SQL If you look at the code in the image above, I have one immediate reaction. What are those numbers that are sprinkled throughout the …

  5. TIL: T-SQL doesn't have constants and variables aren't a good ...

    Apr 4, 2022 · SQL Server doesn’t have a keyword for constants. To introduce constants in stored procedures, write literal values next to an explaining comment or use single-row views with the …

  6. sql-docs/docs/t-sql/data-types/constants-transact-sql.md at ...

    A constant, also known as a literal or a scalar value, is a symbol that represents a specific data value. The format of a constant depends on the data type of the value it represents. Note The …

  7. AvoidConstants” in T-SQL | Matthew McGiffen - LinkedIn

    Avoid “Constants” in T-SQLI found the part highlighting the difference between parameterised sprocs and variables inside queries particularly valuable. Without that someone might have …

  8. Avoid using constants in an ORDER BY clause | Redgate

    Feb 21, 2020 · It wasn’t a big deal but was an irritation and looked clumsy. Using constants in the ORDER BY clause SQL initially got around the problem, without fixing the underlying flaw, by …