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

  • SEARCH
  • Home
  • 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
I have an SP in SQL Server which runs hundreds of times a minute,
I have installed SQL Server 2005 three times now on the same box. I
I'm writing reports on SQL Server Reporting Server that have a number of hours
Is there a way of finding all the rows that have been updated by
I have a table in Sql Server 2008 Express which contains 18 million records.
I have a table in SQL Server 2008 that stores date/time values as varchar(max)
In SQL Server there is a way to join tables from multiple sql servers
I'm trying to transfer some data from Access to SQL Server 2000 (there are
SQL Server 2000: Is there a way to find out server memory / CPU

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.