Monday, March 26, 2012
Retrun all rows on Any Table from EM prompts for Username/Password .. Why ?
I dont know something weired happened on our MSSQL server today. We are able to connect to any Databases from Enterprise Manager from a Remote server.
Once we logged in and connected to a database on my database server, it keep prompting for the user id and password as we browsing through different tables in that database?
(Right click on the table then select Open Table -> Return all rows -> and it prompts for password )
Now when we enter password the contents of Table are displayed and now when we try to see contents of another table in the database it again prompts for password.
Any Idea whats wrong? How this can be resolved as it was not happening before .. :(Weird, I'd try changing the registration of the server in EP and see if that fixes it.
Retriving users, roles and roles assigned to each user from the database.
it in enterprise manager. Is there a way to query the
database for the follwing informations below.
1) a list of database users
2) what roles are set up in the database
3) which users are assigned to which roles (i.e. what
privs do the users have)
"Aboki" <hcokoli@.yahoo.com> wrote in message
news:c5d601c47a3d$6847dbb0$a501280a@.phx.gbl...
>
> How do I get this information without manually check for
> it in enterprise manager. Is there a way to query the
> database for the follwing informations below.
> 1) a list of database users
> 2) what roles are set up in the database
> 3) which users are assigned to which roles (i.e. what
> privs do the users have)
1. SELECT * FROM sysusers WHERE issqlrole = 0
2. SELECT * FROM sysusers WHERE issqlrole = 1 OR isapprole = 1
3. exec sp_helprolemember
HTH
Rick Sawtell
MCT, MCSD, MCDBA
Retriving users, roles and roles assigned to each user from the database.
it in enterprise manager. Is there a way to query the
database for the follwing informations below.
1) a list of database users
2) what roles are set up in the database
3) which users are assigned to which roles (i.e. what
privs do the users have)"Aboki" <hcokoli@.yahoo.com> wrote in message
news:c5d601c47a3d$6847dbb0$a501280a@.phx.gbl...
>
> How do I get this information without manually check for
> it in enterprise manager. Is there a way to query the
> database for the follwing informations below.
> 1) a list of database users
> 2) what roles are set up in the database
> 3) which users are assigned to which roles (i.e. what
> privs do the users have)
1. SELECT * FROM sysusers WHERE issqlrole = 0
2. SELECT * FROM sysusers WHERE issqlrole = 1 OR isapprole = 1
3. exec sp_helprolemember
HTH
Rick Sawtell
MCT, MCSD, MCDBA
Retriving users, roles and roles assigned to each user from the database.
it in enterprise manager. Is there a way to query the
database for the follwing informations below.
1) a list of database users
2) what roles are set up in the database
3) which users are assigned to which roles (i.e. what
privs do the users have)"Aboki" <hcokoli@.yahoo.com> wrote in message
news:c5d601c47a3d$6847dbb0$a501280a@.phx.gbl...
>
> How do I get this information without manually check for
> it in enterprise manager. Is there a way to query the
> database for the follwing informations below.
> 1) a list of database users
> 2) what roles are set up in the database
> 3) which users are assigned to which roles (i.e. what
> privs do the users have)
1. SELECT * FROM sysusers WHERE issqlrole = 0
2. SELECT * FROM sysusers WHERE issqlrole = 1 OR isapprole = 1
3. exec sp_helprolemember
HTH
Rick Sawtell
MCT, MCSD, MCDBA
Wednesday, March 21, 2012
Retrieving OLAP Cube Names from AM2000
I am trying to retrieve the Cube names from Analysis Manager 2000 by using DSO objects in VS2005.NET C# 2.0 ( framework 2.0)
The code is something like that.
DSO.Server srv = new DSO.Server();
srv.Connect("localhost");
after that i do not what to do in order to get the cube names from AM2000.
when i do the following
srv.MDStore.Count
i can get the number of the cubes but i cant get the names.
I tried to use the following method but did not work out.
srv.MDStore.Item(object vntIndexKey)
May be i do not know how to use the above method to get the cube names.
for(int i = 0; i < srv.MDStore.Count; i++)
combobox1.Item.Add(srv.MDStore.Item(i).ToString());
the above code does not add the cube names into combobox, either. (
Please somebody help me with this problem.
I need to get the cube names from the AM2000 to let the user choose what cube he/she wants to work with!?
thanks in advance
best regards
Tunc OVACIK
DSO is the wrong API to use for something ordinary users need to run. DSO is the admin API and will only work for OLAP Administrators.
You should use the ADOMD or ADOMD.NET api, the MDX Sample app has code that does this using the older ADOMD API.
There is a sample in BOL for using ADOMD.NET to get a list of cubes which I have copied out below, the original page is available here
ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/adodw9/html/0183dcdc-f2ea-4246-ad00-6e8ccc9d8217.htm
Code Snippet
private string RetrieveCubesAndDimensions()
{
System.Text.StringBuilder result = new System.Text.StringBuilder();
//Connect to the local server
using (AdomdConnection conn = new AdomdConnection("Data Source=localhost;"))
{
conn.Open();
//Loop through every cube
foreach (CubeDef cube in conn.Cubes)
{
//Skip hidden cubes.
if (cube.Name.StartsWith("$"))
continue;
//Write the cube name
result.AppendLine(cube.Name);
//Write out all dimensions, indented by a tab.
foreach (Dimension dim in cube.Dimensions)
{
result.Append("\t");
result.AppendLine(dim.Name);
}
}
//Close the connection
conn.Close();
}
//Return the results
return result.ToString();
}
Hello again,
I have succedded to get the cube names from AM2000 by using DSO API. To do this job with DSO API is very easy.
For further information for the others who may need it I will give the sample code.
string[] cubeNames;
DSO.Server dsoServer = new DSO.Server();
dsoServer.Connect("localhost");
// Count will return the number of cubes on AM2000
cubeNames = new string[dsoServer.MDStore.Count];
int i = 0;
foreach( DSO.MDStore cube in dsoServer.MDStore)
{
cubeNames = cube.Name;
i++;
}
Before going through the code you should add the relevant .dll file into your project from the "Add Reference" menu.
Actually it is possible to get the cube names by using ADOMD classes as well as Darren said. I thank you for your help which was really usefull. So, the next step for me is to go through the cube and get the neccesarry data I need to make report for the user.
thanks for everything
Tunc OVACIK
|||The DSO code will only work for administrators, you can run it because you are an admin, normal users will not be able to run it. Hence the reason I suggested using Adomd.Retrieving OLAP Cube Names from AM2000
I am trying to retrieve the Cube names from Analysis Manager 2000 by using DSO objects in VS2005.NET C# 2.0 ( framework 2.0)
The code is something like that.
DSO.Server srv = new DSO.Server();
srv.Connect("localhost");
after that i do not what to do in order to get the cube names from AM2000.
when i do the following
srv.MDStore.Count
i can get the number of the cubes but i cant get the names.
I tried to use the following method but did not work out.
srv.MDStore.Item(object vntIndexKey)
May be i do not know how to use the above method to get the cube names.
for(int i = 0; i < srv.MDStore.Count; i++)
combobox1.Item.Add(srv.MDStore.Item(i).ToString());
the above code does not add the cube names into combobox, either. (
Please somebody help me with this problem.
I need to get the cube names from the AM2000 to let the user choose what cube he/she wants to work with!?
thanks in advance
best regards
Tunc OVACIK
DSO is the wrong API to use for something ordinary users need to run. DSO is the admin API and will only work for OLAP Administrators.
You should use the ADOMD or ADOMD.NET api, the MDX Sample app has code that does this using the older ADOMD API.
There is a sample in BOL for using ADOMD.NET to get a list of cubes which I have copied out below, the original page is available here
ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/adodw9/html/0183dcdc-f2ea-4246-ad00-6e8ccc9d8217.htm
Code Snippet
private string RetrieveCubesAndDimensions()
{
System.Text.StringBuilder result = new System.Text.StringBuilder();
//Connect to the local server
using (AdomdConnection conn = new AdomdConnection("Data Source=localhost;"))
{
conn.Open();
//Loop through every cube
foreach (CubeDef cube in conn.Cubes)
{
//Skip hidden cubes.
if (cube.Name.StartsWith("$"))
continue;
//Write the cube name
result.AppendLine(cube.Name);
//Write out all dimensions, indented by a tab.
foreach (Dimension dim in cube.Dimensions)
{
result.Append("\t");
result.AppendLine(dim.Name);
}
}
//Close the connection
conn.Close();
}
//Return the results
return result.ToString();
}
Hello again,
I have succedded to get the cube names from AM2000 by using DSO API. To do this job with DSO API is very easy.
For further information for the others who may need it I will give the sample code.
string[] cubeNames;
DSO.Server dsoServer = new DSO.Server();
dsoServer.Connect("localhost");
// Count will return the number of cubes on AM2000
cubeNames = new string[dsoServer.MDStore.Count];
int i = 0;
foreach( DSO.MDStore cube in dsoServer.MDStore)
{
cubeNames = cube.Name;
i++;
}
Before going through the code you should add the relevant .dll file into your project from the "Add Reference" menu.
Actually it is possible to get the cube names by using ADOMD classes as well as Darren said. I thank you for your help which was really usefull. So, the next step for me is to go through the cube and get the neccesarry data I need to make report for the user.
thanks for everything
Tunc OVACIK
|||The DSO code will only work for administrators, you can run it because you are an admin, normal users will not be able to run it. Hence the reason I suggested using Adomd.