1

I need to use some values (table values Ex: StudentId) in many Stored procedures. So I need to query that value in every stored procedure. In MVC I am able to store that value in WebConfig. But in SQL how can I do that?

Is there any option to store that value globally to refer it in a Stored procedure?

tux3
  • 7,171
  • 6
  • 39
  • 51

2 Answers2

1

If you need configuration values in a database, you can just create a new table and call it something like ConfigurationParameters, then query whenever you need a value from it.

If you can't do that, then create a StoredProcedure or Function that always returns the value you need.

0

It does not look like you can directly make global variables SQL server.

I found another question that is very similar to yours with useful information.

how to declare global variable in SQL Server..?

Hope this helps.

Community
  • 1
  • 1