0

I want a function similar to @@servername to be created. So, the new @@mycustomname will return something I set up and then I can use @@mycustomname in my deployed T-SQL Scripts.

Is there a way to do it?

1
  • 1
    I am not certain but I believe the designation of @@(something) is a system reserved variable. I don't believe you can create these things. However if you just want a return for metadata or other types that is definitely possible with Scalar functions or custom types. It all depends on what you want to return. Commented Feb 22, 2013 at 19:55

1 Answer 1

0

No you can't. These are reserved keywords.

What you want to be somewhat equivalent to global variables, which unfortunately does not exists.

The best you can do is declare a function.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.