querying a table in Master as a semaphore
- From: "Jeremy" <jeremy-nospam@xxxxxxxxxxxxxx>
- Date: Sat, 24 Mar 2007 09:22:00 -0700
We have a production database and a test database on different servers, but
with the same name, and we want our programs to be able to tell which is
which, so we created a table in Master on the production server only. It
oughta be really easy to query for this table and know if you're on test or
production. At the same time, if we restore the test database from the
production database, we won't run the risk of forgetting to change the
semaphore.
Problem is, the stored proc in the database seems unable to select from
master.sys.objects when executed from an application, and therefore returns
the wrong answer. I temporarily fixed that by giving access to Master for
the login being used, and then giving this login select permission. But
this is a really dirty answer. How can I allow a stored proc access to
master without opening the barn door like this?
Jeremy
.
- Follow-Ups:
- Re: querying a table in Master as a semaphore
- From: TheSQLGuru
- Re: querying a table in Master as a semaphore
- Prev by Date: Re: Losing connections with SQL 2005
- Next by Date: difference between Owned schemas and Roles members
- Previous by thread: Re: Losing connections with SQL 2005
- Next by thread: Re: querying a table in Master as a semaphore
- Index(es):
Relevant Pages
|
Loading