Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6136767
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:38:35+00:00 2026-05-23T17:38:35+00:00

In SQL server, there are times when I have a variable which may change,

  • 0

In SQL server, there are times when I have a variable which may change, that many stored procedures all use and just think it would be cool if I could store it as an ‘@@variable’ (like @@servername).

Is it possible to create your own ‘@@variable’? And if so, how do you do it?

(using sql server 2008)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T17:38:36+00:00Added an answer on May 23, 2026 at 5:38 pm

    I’d go with using a real table to hold your global values, then it’ll survive between restarts/connections. There is a good example of that here: http://weblogs.sqlteam.com/mladenp/archive/2007/04/23/60185.aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi all SQL Server Blackbelt masters out there. I have a simple question that
In SQL Server 2005, are there any disadvantages to making all character fields nvarchar(MAX)
I am building an ASP.NET web application that will use SQL Server for data
I have a simple stored procedure in T-SQL that is instant when run from
SQL Server 2000: Is there a way to find out server memory / CPU
Within SQL Server Integration Services (SSIS) there is the ability to setup a connection
On Sql Server 2000, is there a way to find out the date and
In SQL Server 2005, is there a way of deleting rows and being told
In SQL Server 2005, is there a way for a trigger to find out
In SQL Server 2005, is there a way I can create a INSERT script

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.