You can look at these commands, but I beleive you need elevated permissions to see other people on the server.
Maybe you could write a web service that connects to the database with Admin privs and returns the list of users for each request. This would allow you current user configuration no to change, just some additional functionality would be published.
I want to secure a database in SQL Server 2008. Here is the situation description:
I am using both 'windows' and 'sa' authentication. When I create a database (logged as 'windows' authenticated) I can see and change it (create tables, stored procedures) from logged as 'sa' authentication or vice versa. So, there is no difference whether I create it logged as 'windows' or 'sa'. But, what I need is to secure a particular database i.e. even if I am logged as 'windows' I want the particular database to be accessed only by providing a username and password.
Do you have any idea how to resolve this?
You didn't provided solution, that is just an article of capabilities.
I don't have to provide a solution. I'm not at work, this 'advice' is being given in my own spare time. I could be doing something productive, like the dishes, but I had chosen to answer this question. Might benefit someone, and I'm sure the dishes do not mind waiting
Kujtim Hyseni wrote:
I need short and precise guide.
You already have - it's called the documentation[^]. Right on the first lines, it states short and precise;
There are two possible modes: Windows Authentication mode and mixed mode.
Kujtim Hyseni wrote:
By the way, I don't use MySQL nor Oracle.
They were provided as alternative solutions to your problem.
I'm not going to provide any further pointers, as doing the dishes seems like a more important task suddenly.
Select EventID,(select count(*) from <myeventtable> E2 where E1.EventID = E2.EventID) As Count_of_A, (select count(*) from <myeventtable> E3 where E1.EventID = E3.EventID) As Count_of_B,
from <myeventtable> E1
I haven't tried this, however my first try would look like this:
SELECT DISTINCT UserID, StateCount_of_A, StateCount_of_B FROM tablename AS T1
LEFT JOIN (SELECT UserID, COUNT(*) AS StateCount_of_A FROM tablename AS TA WHERE State='A') ON TA.UserID = T1.UserID
LEFT JOIN (SELECT UserID, COUNT(*) AS StateCount_of_B FROM tablename AS TB WHERE State='B') ON TB.UserID = T1.UserID
ORDER BY UserID
(Actually I would try a subset of it with a single state first, then expand for the exact requirements).
The fundamental trick is to use the same table more than once, and give each "instance" a different name using the AS keyword.
And then one might have to throw in a couple of COALESCE functions to replace null counts by zeroes.
,CASE WHEN [State]='A' THEN 1 ELSE 0 END StateA
,CASE WHEN [State]='B' THEN 1 ELSE 0 END StateB
GROUP BY UserID
No, my 'base' or don't know how to call it server works fine and I am connecting to it as usual via 'Microsoft SQL Server Management Studio'. But when I enter to 'Microsoft SQL Server Management Studio' and try to register new server i.e. from the menu I choose from menu 'Register...' then appears the form 'New Server Registration' I cannot save this new server but cannot start it.