Thursday, March 8, 2012
Another Login after restoring database
I have created a backup of a database and Restored as a new database in another machine.
Primary login of the database was X , now after restoring as a new database I dont want X as the login name i want it to be Y ...
how to do that ?
I can create other login as y and Give necessary premissions...but the Problem is i have to manually issue all the permissions to the new user which i feel is a time taking process.
Please let me know about it..
Thanks and Regards
saiI am not sure but u can try this :
script the login and user for the database in question,after generating the script for the user X,delete the the user X from the database ,Replace the user/login name X from the script with Y and run the script on the database.
I think this should work after some enhancements in the script.|||Use roles!
Or sp_change_users_login SP
Wednesday, March 7, 2012
Another Date Picker question
I created a report with two parameters, StartDate and EndDate.
They are specified as datetime type.
When I went to the Preview tab, there were date pickers for both values.
After a week or so of using the report, I thought it would be better if I gave the parameters default values. I spent some time reading what others had done in this forum and used the following as the expressions for the parameters:
Code Snippet
=IIF(Weekday(Today()) =1, FormatDateTime(Today(),2),
IIF(Weekday(Today()) =2, FormatDateTime(Today.AddDays(-1),2),
IIF(Weekday(Today()) =3, FormatDateTime(Today.AddDays(-2),2),
IIF(Weekday(Today()) =4, FormatDateTime(Today.AddDays(-3),2),
IIF(Weekday(Today()) =5, FormatDateTime(Today.AddDays(-4),2),
IIF(Weekday(Today()) =6, FormatDateTime(Today.AddDays(-5),2), FormatDateTime(Today.AddDays(-6),2)))))))
=IIF(Weekday(Today()) =1, FormatDateTime(Today.AddDays(6),2),
IIF(Weekday(Today()) =2, FormatDateTime(Today.AddDays(5),2),
IIF(Weekday(Today()) =3, FormatDateTime(Today.AddDays(4),2),
IIF(Weekday(Today()) =4, FormatDateTime(Today.AddDays(3),2),
IIF(Weekday(Today()) =5, FormatDateTime(Today.AddDays(2),2),
IIF(Weekday(Today()) =6, FormatDateTime(Today.AddDays(1),2), FormatDateTime(Today(),2)))))))
and now, there are no date pickers. I am curious. Why are they gone? Can I get them back and still have my default values?
Thanks,
IanO
Try removing the FormatDateTime function.|||Thanks for your reply. Allow me to explain why the Format is there.
When I had not specified default values for the report parameters, the date pickers provided values that were dates only - no time values. After I put in the IIFs for the default values, the defaults included 12:00:00 AM with the date.
I hunted for quite a while and the solution that I chose was the Format. Perhaps you have another idea of how I can have a default Sunday and a default Saturday for the current week, without the time?
Thanks,
IanO
|||It's odd that the default values gave you a time. I used it here and had only date values. Hmmmm.
Code Snippet
=CDATE(IIF(Weekday(Today()) =1, FormatDateTime(Today(),2),IIF(Weekday(Today()) =2, FormatDateTime(Today.AddDays(-1),2),
IIF(Weekday(Today()) =3, FormatDateTime(Today.AddDays(-2),2),
IIF(Weekday(Today()) =4, FormatDateTime(Today.AddDays(-3),2),
IIF(Weekday(Today()) =5, FormatDateTime(Today.AddDays(-4),2),
IIF(Weekday(Today()) =6, FormatDateTime(Today.AddDays(-5),2), FormatDateTime(Today.AddDays(-6),2))))))))
Code Snippet
=CDATE(IIF(Weekday(Today()) =1, FormatDateTime(Today.AddDays(6),2),IIF(Weekday(Today()) =2, FormatDateTime(Today.AddDays(5),2),
IIF(Weekday(Today()) =3, FormatDateTime(Today.AddDays(4),2),
IIF(Weekday(Today()) =4, FormatDateTime(Today.AddDays(3),2),
IIF(Weekday(Today()) =5, FormatDateTime(Today.AddDays(2),2),
IIF(Weekday(Today()) =6, FormatDateTime(Today.AddDays(1),2), FormatDateTime(Today(),2))))))))
Then make sure your datatype is date because using just your original expression you get an error if the datatype is not a string.
Simone
Another Check Constraint Error.
StudentInfo. In the constraint expression I put Date = GETDATE() and
unchecked the "check existing date on creation" and the "enforce constraint
for replication" check boxes. I left the "Enforce constraint for INSERTs and
UPDATEs" checked. However, when I teachers tried to update this field this
morning, and enter today's date, they all got check constraint errors. Does
anybody have any idea what might be wrong? All I want is for the Date field
to only accept the current date when being updated.
Any help would be appreciated, I only have 9 teachers but, everyday at least
1 will get the date wrong.
Thanks.
KevinKevin,
GETDATE returns the current date and time accurate to 1/300 of a
second. It's very unlikely that anyone entering data by hand would
happen to enter precisely this value. If you want to get a date-only
for today into the table, instead of having the teacher enter it, why
not use a default on that column of
DATEADD(dd,DATEDIFF(dd,0,GETDATE()),0) and leave that column out of the
column list and values the teacher enters?
SK
Kevin Sinclair wrote:
>I have created a check constraint on a field called Date in a table called
>StudentInfo. In the constraint expression I put Date = GETDATE() and
>unchecked the "check existing date on creation" and the "enforce constraint
>for replication" check boxes. I left the "Enforce constraint for INSERTs and
>UPDATEs" checked. However, when I teachers tried to update this field this
>morning, and enter today's date, they all got check constraint errors. Does
>anybody have any idea what might be wrong? All I want is for the Date field
>to only accept the current date when being updated.
>Any help would be appreciated, I only have 9 teachers but, everyday at least
>1 will get the date wrong.
>Thanks.
>Kevin
>
>|||I can't use a default because there is already a date in the field. What is
supposed to happen is the teachers update this field when they do their
daily attendance. However, at least 1 teacher every day, will input the
wrong date. When this database was in access I used a validation rule on
this field, I need a way to do the same thing in SQL Server 2000.
Thanks.
Kevin
"Steve Kass" <skass@.drew.edu> wrote in message
news:uAltir$7DHA.3112@.tk2msftngp13.phx.gbl...
> Kevin,
> GETDATE returns the current date and time accurate to 1/300 of a
> second. It's very unlikely that anyone entering data by hand would
> happen to enter precisely this value. If you want to get a date-only
> for today into the table, instead of having the teacher enter it, why
> not use a default on that column of
> DATEADD(dd,DATEDIFF(dd,0,GETDATE()),0) and leave that column out of the
> column list and values the teacher enters?
> SK
> Kevin Sinclair wrote:
> >I have created a check constraint on a field called Date in a table
called
> >StudentInfo. In the constraint expression I put Date = GETDATE() and
> >unchecked the "check existing date on creation" and the "enforce
constraint
> >for replication" check boxes. I left the "Enforce constraint for INSERTs
and
> >UPDATEs" checked. However, when I teachers tried to update this field
this
> >morning, and enter today's date, they all got check constraint errors.
Does
> >anybody have any idea what might be wrong? All I want is for the Date
field
> >to only accept the current date when being updated.
> >
> >Any help would be appreciated, I only have 9 teachers but, everyday at
least
> >1 will get the date wrong.
> >
> >Thanks.
> >
> >Kevin
> >
> >
> >
> >
>|||Kevin,
You can check for the same value I was suggesting as a default:
create table Kevin (
...
dateCol datetime CHECK (dateCol = DATEADD(dd,DATEDIFF(dd,0,GETDATE()),0))
...
Steve
Kevin Sinclair wrote:
>I can't use a default because there is already a date in the field. What is
>supposed to happen is the teachers update this field when they do their
>daily attendance. However, at least 1 teacher every day, will input the
>wrong date. When this database was in access I used a validation rule on
>this field, I need a way to do the same thing in SQL Server 2000.
>Thanks.
>Kevin
>
>"Steve Kass" <skass@.drew.edu> wrote in message
>news:uAltir$7DHA.3112@.tk2msftngp13.phx.gbl...
>
>>Kevin,
>> GETDATE returns the current date and time accurate to 1/300 of a
>>second. It's very unlikely that anyone entering data by hand would
>>happen to enter precisely this value. If you want to get a date-only
>>for today into the table, instead of having the teacher enter it, why
>>not use a default on that column of
>>DATEADD(dd,DATEDIFF(dd,0,GETDATE()),0) and leave that column out of the
>>column list and values the teacher enters?
>>SK
>>Kevin Sinclair wrote:
>>
>>I have created a check constraint on a field called Date in a table
>>
>called
>
>>StudentInfo. In the constraint expression I put Date = GETDATE() and
>>unchecked the "check existing date on creation" and the "enforce
>>
>constraint
>
>>for replication" check boxes. I left the "Enforce constraint for INSERTs
>>
>and
>
>>UPDATEs" checked. However, when I teachers tried to update this field
>>
>this
>
>>morning, and enter today's date, they all got check constraint errors.
>>
>Does
>
>>anybody have any idea what might be wrong? All I want is for the Date
>>
>field
>
>>to only accept the current date when being updated.
>>Any help would be appreciated, I only have 9 teachers but, everyday at
>>
>least
>
>>1 will get the date wrong.
>>Thanks.
>>Kevin
>>
>>
>>
>
>|||Oops. Ignore my previous message. The check constraint will fail
tomorrow if you update the row! You may need to use a trigger. What
you could do is put in the default and execute the update with:
UPDATE Attendance SET
this = whatever,
that = whatever,
dateCol = DEFAULT
WHERE
keyCol = theRowBeingEdited
SK
Kevin Sinclair wrote:
>I can't use a default because there is already a date in the field. What is
>supposed to happen is the teachers update this field when they do their
>daily attendance. However, at least 1 teacher every day, will input the
>wrong date. When this database was in access I used a validation rule on
>this field, I need a way to do the same thing in SQL Server 2000.
>Thanks.
>Kevin
>
>"Steve Kass" <skass@.drew.edu> wrote in message
>news:uAltir$7DHA.3112@.tk2msftngp13.phx.gbl...
>
>>Kevin,
>> GETDATE returns the current date and time accurate to 1/300 of a
>>second. It's very unlikely that anyone entering data by hand would
>>happen to enter precisely this value. If you want to get a date-only
>>for today into the table, instead of having the teacher enter it, why
>>not use a default on that column of
>>DATEADD(dd,DATEDIFF(dd,0,GETDATE()),0) and leave that column out of the
>>column list and values the teacher enters?
>>SK
>>Kevin Sinclair wrote:
>>
>>I have created a check constraint on a field called Date in a table
>>
>called
>
>>StudentInfo. In the constraint expression I put Date = GETDATE() and
>>unchecked the "check existing date on creation" and the "enforce
>>
>constraint
>
>>for replication" check boxes. I left the "Enforce constraint for INSERTs
>>
>and
>
>>UPDATEs" checked. However, when I teachers tried to update this field
>>
>this
>
>>morning, and enter today's date, they all got check constraint errors.
>>
>Does
>
>>anybody have any idea what might be wrong? All I want is for the Date
>>
>field
>
>>to only accept the current date when being updated.
>>Any help would be appreciated, I only have 9 teachers but, everyday at
>>
>least
>
>>1 will get the date wrong.
>>Thanks.
>>Kevin
>>
>>
>>
>
>
Another Check Constraint Error.
StudentInfo. In the constraint expression I put Date = GETDATE() and
unchecked the "check existing date on creation" and the "enforce constraint
for replication" check boxes. I left the "Enforce constraint for INSERTs and
UPDATEs" checked. However, when I teachers tried to update this field this
morning, and enter today's date, they all got check constraint errors. Does
anybody have any idea what might be wrong? All I want is for the Date field
to only accept the current date when being updated.
Any help would be appreciated, I only have 9 teachers but, everyday at least
1 will get the date wrong.
Thanks.
KevinKevin,
GETDATE returns the current date and time accurate to 1/300 of a
second. It's very unlikely that anyone entering data by hand would
happen to enter precisely this value. If you want to get a date-only
for today into the table, instead of having the teacher enter it, why
not use a default on that column of
DATEADD(dd,DATEDIFF(dd,0,GETDATE()),0) and leave that column out of the
column list and values the teacher enters?
SK
Kevin Sinclair wrote:
>I have created a check constraint on a field called Date in a table called
>StudentInfo. In the constraint expression I put Date = GETDATE() and
>unchecked the "check existing date on creation" and the "enforce constraint
>for replication" check boxes. I left the "Enforce constraint for INSERTs an
d
>UPDATEs" checked. However, when I teachers tried to update this field this
>morning, and enter today's date, they all got check constraint errors. Doe
s
>anybody have any idea what might be wrong? All I want is for the Date field
>to only accept the current date when being updated.
>Any help would be appreciated, I only have 9 teachers but, everyday at leas
t
>1 will get the date wrong.
>Thanks.
>Kevin
>
>|||I can't use a default because there is already a date in the field. What is
supposed to happen is the teachers update this field when they do their
daily attendance. However, at least 1 teacher every day, will input the
wrong date. When this database was in access I used a validation rule on
this field, I need a way to do the same thing in SQL Server 2000.
Thanks.
Kevin
"Steve Kass" <skass@.drew.edu> wrote in message
news:uAltir$7DHA.3112@.tk2msftngp13.phx.gbl...
> Kevin,
> GETDATE returns the current date and time accurate to 1/300 of a
> second. It's very unlikely that anyone entering data by hand would
> happen to enter precisely this value. If you want to get a date-only
> for today into the table, instead of having the teacher enter it, why
> not use a default on that column of
> DATEADD(dd,DATEDIFF(dd,0,GETDATE()),0) and leave that column out of the
> column list and values the teacher enters?
> SK
> Kevin Sinclair wrote:
>
called
constraint
and
this
Does
field
least
>|||Kevin,
You can check for the same value I was suggesting as a default:
create table Kevin (
..
dateCol datetime CHECK (dateCol = DATEADD(dd,DATEDIFF(dd,0,GETDATE()),0))
...
Steve
Kevin Sinclair wrote:
>I can't use a default because there is already a date in the field. What is
>supposed to happen is the teachers update this field when they do their
>daily attendance. However, at least 1 teacher every day, will input the
>wrong date. When this database was in access I used a validation rule on
>this field, I need a way to do the same thing in SQL Server 2000.
>Thanks.
>Kevin
>
>"Steve Kass" <skass@.drew.edu> wrote in message
>news:uAltir$7DHA.3112@.tk2msftngp13.phx.gbl...
>
>called
>
>constraint
>
>and
>
>this
>
>Does
>
>field
>
>least
>
>
>|||Oops. Ignore my previous message. The check constraint will fail
tomorrow if you update the row! You may need to use a trigger. What
you could do is put in the default and execute the update with:
UPDATE Attendance SET
this = whatever,
that = whatever,
dateCol = DEFAULT
WHERE
keyCol = theRowBeingEdited
SK
Kevin Sinclair wrote:
>I can't use a default because there is already a date in the field. What is
>supposed to happen is the teachers update this field when they do their
>daily attendance. However, at least 1 teacher every day, will input the
>wrong date. When this database was in access I used a validation rule on
>this field, I need a way to do the same thing in SQL Server 2000.
>Thanks.
>Kevin
>
>"Steve Kass" <skass@.drew.edu> wrote in message
>news:uAltir$7DHA.3112@.tk2msftngp13.phx.gbl...
>
>called
>
>constraint
>
>and
>
>this
>
>Does
>
>field
>
>least
>
>
>
Sunday, February 19, 2012
Anaylsis Server 2005 and wrong results in dimensions/cube
My cubes are somehow incorrect and I can't find out why:
I created a very simple table, because of wrong results in my project cubes and inserted 102 rows:
-
USE EA_DWH
GO
CREATE TABLE [dbo].[TEST_DWH]
(
[DWSTOREDATE_INT] INT NOT NULL,
[USER_NAME] VARCHAR(20) NULL
)
GO
INSERT INTO TEST_DWH VALUES('20021216','USER_99')
INSERT INTO TEST_DWH VALUES('20021216','USER_99')
INSERT INTO TEST_DWH VALUES('20021216','USER_99')
INSERT INTO TEST_DWH VALUES('20021216','USER_99')
INSERT INTO TEST_DWH VALUES('20021216','USER_99')
INSERT INTO TEST_DWH VALUES('20021216','USER_99')
INSERT INTO TEST_DWH VALUES('20021216','USER_99')
INSERT INTO TEST_DWH VALUES('20021216','USER_99')
INSERT INTO TEST_DWH VALUES('20021216','USER_99')
INSERT INTO TEST_DWH VALUES('20021216','USER_99')
INSERT INTO TEST_DWH VALUES('20021216','USER_99')
INSERT INTO TEST_DWH VALUES('20021216','USER_99')
INSERT INTO TEST_DWH VALUES('20021216','USER_99')
INSERT INTO TEST_DWH VALUES('20021216','USER_99')
INSERT INTO TEST_DWH VALUES('20021216','USER_99')
INSERT INTO TEST_DWH VALUES('20021216','USER_99')
INSERT INTO TEST_DWH VALUES('20021216','USER_99')
INSERT INTO TEST_DWH VALUES('20021216','USER_99')
INSERT INTO TEST_DWH VALUES('20021216','USER_99')
INSERT INTO TEST_DWH VALUES('20021216','USER_99')
INSERT INTO TEST_DWH VALUES('20021216','USER_99')
INSERT INTO TEST_DWH VALUES('20021216','USER_99')
INSERT INTO TEST_DWH VALUES('20021217','USER_03')
INSERT INTO TEST_DWH VALUES('20021218','USER_04')
INSERT INTO TEST_DWH VALUES('20021219','USER_01')
INSERT INTO TEST_DWH VALUES('20021219','USER_01')
INSERT INTO TEST_DWH VALUES('20021219','USER_01')
INSERT INTO TEST_DWH VALUES('20021219','USER_01')
INSERT INTO TEST_DWH VALUES('20021219','USER_01')
INSERT INTO TEST_DWH VALUES('20021219','USER_01')
INSERT INTO TEST_DWH VALUES('20021219','USER_01')
INSERT INTO TEST_DWH VALUES('20021219','USER_01')
INSERT INTO TEST_DWH VALUES('20021219','USER_01')
INSERT INTO TEST_DWH VALUES('20021219','USER_01')
INSERT INTO TEST_DWH VALUES('20021219','USER_01')
INSERT INTO TEST_DWH VALUES('20021219','USER_01')
INSERT INTO TEST_DWH VALUES('20021219','USER_01')
INSERT INTO TEST_DWH VALUES('20021219','USER_01')
INSERT INTO TEST_DWH VALUES('20021219','USER_01')
INSERT INTO TEST_DWH VALUES('20021219','USER_01')
INSERT INTO TEST_DWH VALUES('20021219','USER_01')
INSERT INTO TEST_DWH VALUES('20021219','USER_01')
INSERT INTO TEST_DWH VALUES('20021219','USER_01')
INSERT INTO TEST_DWH VALUES('20021219','USER_01')
INSERT INTO TEST_DWH VALUES('20021219','USER_01')
INSERT INTO TEST_DWH VALUES('20021219','USER_01')
INSERT INTO TEST_DWH VALUES('20021219','USER_01')
INSERT INTO TEST_DWH VALUES('20021219','USER_01')
INSERT INTO TEST_DWH VALUES('20021219','USER_01')
INSERT INTO TEST_DWH VALUES('20021219','USER_01')
INSERT INTO TEST_DWH VALUES('20021219','USER_01')
INSERT INTO TEST_DWH VALUES('20021219','USER_01')
INSERT INTO TEST_DWH VALUES('20021219','USER_01')
INSERT INTO TEST_DWH VALUES('20021219','USER_01')
INSERT INTO TEST_DWH VALUES('20021219','USER_01')
INSERT INTO TEST_DWH VALUES('20021219','USER_01')
INSERT INTO TEST_DWH VALUES('20021219','USER_01')
INSERT INTO TEST_DWH VALUES('20021219','USER_01')
INSERT INTO TEST_DWH VALUES('20021219','USER_01')
INSERT INTO TEST_DWH VALUES('20021219','USER_01')
INSERT INTO TEST_DWH VALUES('20021219','USER_01')
INSERT INTO TEST_DWH VALUES('20021219','USER_01')
INSERT INTO TEST_DWH VALUES('20021219','USER_01')
INSERT INTO TEST_DWH VALUES('20021219','USER_01')
INSERT INTO TEST_DWH VALUES('20021219','USER_01')
INSERT INTO TEST_DWH VALUES('20021219','USER_01')
INSERT INTO TEST_DWH VALUES('20021219','USER_01')
INSERT INTO TEST_DWH VALUES('20021219','USER_01')
INSERT INTO TEST_DWH VALUES('20021219','USER_01')
INSERT INTO TEST_DWH VALUES('20021219','USER_01')
INSERT INTO TEST_DWH VALUES('20021219','USER_01')
INSERT INTO TEST_DWH VALUES('20021219','USER_01')
INSERT INTO TEST_DWH VALUES('20021219','USER_01')
INSERT INTO TEST_DWH VALUES('20021219','USER_01')
INSERT INTO TEST_DWH VALUES('20021219','USER_01')
INSERT INTO TEST_DWH VALUES('20021219','USER_01')
INSERT INTO TEST_DWH VALUES('20021219','USER_01')
INSERT INTO TEST_DWH VALUES('20021219','USER_01')
INSERT INTO TEST_DWH VALUES('20021219','USER_01')
INSERT INTO TEST_DWH VALUES('20021219','USER_01')
INSERT INTO TEST_DWH VALUES('20021219','USER_01')
INSERT INTO TEST_DWH VALUES('20021219','USER_01')
INSERT INTO TEST_DWH VALUES('20021219','USER_01')
INSERT INTO TEST_DWH VALUES('20021219','USER_01')
INSERT INTO TEST_DWH VALUES('20021219','USER_01')
INSERT INTO TEST_DWH VALUES('20021219','USER_01')
INSERT INTO TEST_DWH VALUES('20021220','USER_01')
INSERT INTO TEST_DWH VALUES('20021220','USER_01')
INSERT INTO TEST_DWH VALUES('20021220','USER_01')
INSERT INTO TEST_DWH VALUES('20021220','USER_01')
INSERT INTO TEST_DWH VALUES('20021220','USER_01')
INSERT INTO TEST_DWH VALUES('20021220','USER_01')
INSERT INTO TEST_DWH VALUES('20021220','USER_01')
INSERT INTO TEST_DWH VALUES('20021220','USER_01')
INSERT INTO TEST_DWH VALUES('20021220','USER_03')
INSERT INTO TEST_DWH VALUES('20021220','USER_02')
INSERT INTO TEST_DWH VALUES('20021220','USER_02')
INSERT INTO TEST_DWH VALUES('20021220','USER_02')
INSERT INTO TEST_DWH VALUES('20021220','USER_03')
INSERT INTO TEST_DWH VALUES('20021220','USER_02')
INSERT INTO TEST_DWH VALUES('20021220','USER_02')
INSERT INTO TEST_DWH VALUES('20021220','USER_03')
GO
-
The first value of this table represents the date value as integer and the second value is the user name.
Now when building a cube (I) you will find out that the values differ to a simple group by on the sql database (II):
I count all user and the dimension is build on DWSTOREDATE_INT (logical key) as key attribute and USER_Name as regular attribute.
(I):
-
-
(II):
-
SQL query (SQL Server):
SELECT DWSTOREDATE_INT, USER_NAME, COUNT(*) AS Count_StoreDate_User
FROM TEST_DWH
GROUP BY DWSTOREDATE_INT, USER_NAME
ORDER BY DWSTOREDATE_INT
RESULT:
DWSTOREDATE_INT USER_NAME Count_StoreDate_User
-- --
20021216 USER_99 22
20021217 USER_03 1
20021218 USER_04 1
20021219 USER_01 62
20021220 USER_01 8
20021220 USER_02 5
20021220 USER_03 3
(7 row(s) affected)
-
I tried this example on three different computers and can't find out why this happens. On Analysis Server 2000 it works correctly.
My computer:
W2K3 (SP1), SQL Server 2005 EE (SP1 CTP)
I had the same results without SP1 CTP and installed it because I thought this issue may be corrected.
Please help me solve this problem.
Best regards
You are correct. This is one of the cases where AS2005 is different from AS2000.
In your example you have a case of dimension that is based on the non-unique key attribute.
In AS 2000 Analysis Server automatically makes a dimension key unique by concatenating all levels to the key level ( lowest level in the dimension). In AS 2005 this is no longer the case. Although in simple cases (like you have here) you might be little confused at first, the real gain comes in AS2005 being able to implement better performing and scalable dimensions.
To fix the problem in your dimension, you need to define your composite key for your dimension key attribute. Add USER_NAME column to the KeyColumn of your dimension key attribute.
Edward.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Thursday, February 16, 2012
Analysis Services Role created via AMO has unknown problem.
Hi,
This is a wierd problem so I hope I can explain the situation clearly
I'm creating a single role via AMO for an Analysis Services database and adding domain users to the role just fine. When our 3rd party reporting tool tries to create a report an error gets generated and they bubble back the error shown below.
Now here is the wierd part...if I simply view the Role in SQL Server Managment Management Studio and click OK the problem goes away. If I click Cancel when viewing the Role the problem persists. Obviously when I click "OK" in the Role dialog some sort of save routine is going on and fixes whatever problem is present.
I'm creating the role using standard MSDN examples and everything looks in order. Any suggestions on how I can better track down what the problem is?
System.Exception: Exception has been thrown by the target of an invocation. at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) ThanksCould you post the code you use to generate the role? I'll compare it to some code we have that is working. My first guess is there is probably something not quite right in the permissions.
Bryan
|||To see what is different (between the role create with AMO and the role fixed by the dialog), you can do this:
- re-create the role with AMO
- connect with 'SQL Management Studio' and script the Create or Alter operation of the role (right click on the role and there should be the 'Script' option)
- run the role dialog, press 'OK'
- script again and compare with the previous script
Adrian Dumitrascu
Monday, February 13, 2012
Analysis Services Project - A connection cannot be made. Ensure the server is running.
Hi there
I have created an Analysis services project on a laptop running developer edition SQL 2005. The database is hosted on the local machine. When I attempt to debug or deploy the project I get an error;
Error 1 The project could not be deployed to the 'localhost' server because of the following connectivity problems : A connection cannot be made. Ensure that the server is running. To verify or update the name of the target server, right-click on the project in Solution Explorer, select Project Properties, click on the Deployment tab, and then enter the name of the server.
It seems bizarre as I can view tables, create dimensions, cubes etc also I have database as a connection in the server explorer.
I have checked that the services are running, I've restarted them also just in case.
Any ideas would be much appreciated.
Regards,
Derek
Hello derek
I got the same problem yesterday and the solution to this problem is to right click on the project in solution explorer.say MovieSample is a project right click on it and then go to Properties.In properties on th left hand side select deployment and change the server name.By default the server name is localHost so replace it with your machine name and then instance of sql server 2005 like aliraza/sqlserver2005.
try this and i am pretty sure that this will work fine for you.
ali
|||This post looks old but for those of you just looking now you might also try making sure you have Analysis Services started.|||Hi,
What is Analysis Serves? How can I start it? And I entered my server name but still it is saying me same error. Error 1 The project could not be deployed to the 'xxxx(my server name)' server because of the following connectivity problems : A connection cannot be made. Ensure that the server is running. To verify or update the name of the target server, right-click on the project in Solution Explorer, select Project Properties, click on the Deployment tab, and then enter the name of the server.
I am totally new in this area..
Please solve it.. Thanks.
Analysis Services Project - A connection cannot be made. Ensure the server is running.
Hi there
I have created an Analysis services project on a laptop running developer edition SQL 2005. The database is hosted on the local machine. When I attempt to debug or deploy the project I get an error;
Error 1 The project could not be deployed to the 'localhost' server because of the following connectivity problems : A connection cannot be made. Ensure that the server is running. To verify or update the name of the target server, right-click on the project in Solution Explorer, select Project Properties, click on the Deployment tab, and then enter the name of the server.
It seems bizarre as I can view tables, create dimensions, cubes etc also I have database as a connection in the server explorer.
I have checked that the services are running, I've restarted them also just in case.
Any ideas would be much appreciated.
Regards,
Derek
Hello derek
I got the same problem yesterday and the solution to this problem is to right click on the project in solution explorer.say MovieSample is a project right click on it and then go to Properties.In properties on th left hand side select deployment and change the server name.By default the server name is localHost so replace it with your machine name and then instance of sql server 2005 like aliraza/sqlserver2005.
try this and i am pretty sure that this will work fine for you.
ali
|||This post looks old but for those of you just looking now you might also try making sure you have Analysis Services started.|||Hi,
What is Analysis Serves? How can I start it? And I entered my server name but still it is saying me same error. Error 1 The project could not be deployed to the 'xxxx(my server name)' server because of the following connectivity problems : A connection cannot be made. Ensure that the server is running. To verify or update the name of the target server, right-click on the project in Solution Explorer, select Project Properties, click on the Deployment tab, and then enter the name of the server.
I am totally new in this area..
Please solve it.. Thanks.
|||
Hi,
1.Make sure you have entered the server name correctly and
2.if you are connecting to a remote server its fine or if you are connecting to the SSAS through http then you may have to configure that(hit google 4 more help)
I think in your case the SSAS service is not started,mostly SSAS service when installed is tagged as 'manual'
so please 'start' the SSAS service and try deploying !!
|||I'm having the similar problem as stated above. how bout i've got both SSAS running already but still doesnt seems working. what should I do?|||In solutions Explorer
Click Name of the project and right click and go to properties.Expand Configuration Properties and click deployment.Change the server to the correct name of the server with any instance.
Expand Data Sources and double click your data source.Go to imprsonate Information and check use a specific user name and password radio button and enter domain user having sysadmin rights of your database and password.
Analysis Services Project - A connection cannot be made. Ensure the server is running.
Hi there
I have created an Analysis services project on a laptop running developer edition SQL 2005. The database is hosted on the local machine. When I attempt to debug or deploy the project I get an error;
Error 1 The project could not be deployed to the 'localhost' server because of the following connectivity problems : A connection cannot be made. Ensure that the server is running. To verify or update the name of the target server, right-click on the project in Solution Explorer, select Project Properties, click on the Deployment tab, and then enter the name of the server.
It seems bizarre as I can view tables, create dimensions, cubes etc also I have database as a connection in the server explorer.
I have checked that the services are running, I've restarted them also just in case.
Any ideas would be much appreciated.
Regards,
Derek
Hello derek
I got the same problem yesterday and the solution to this problem is to right click on the project in solution explorer.say MovieSample is a project right click on it and then go to Properties.In properties on th left hand side select deployment and change the server name.By default the server name is localHost so replace it with your machine name and then instance of sql server 2005 like aliraza/sqlserver2005.
try this and i am pretty sure that this will work fine for you.
ali
|||This post looks old but for those of you just looking now you might also try making sure you have Analysis Services started.Analysis Services Project - A connection cannot be made. Ensure the server is running.
Hi there
I have created an Analysis services project on a laptop running developer edition SQL 2005. The database is hosted on the local machine. When I attempt to debug or deploy the project I get an error;
Error 1 The project could not be deployed to the 'localhost' server because of the following connectivity problems : A connection cannot be made. Ensure that the server is running. To verify or update the name of the target server, right-click on the project in Solution Explorer, select Project Properties, click on the Deployment tab, and then enter the name of the server.
It seems bizarre as I can view tables, create dimensions, cubes etc also I have database as a connection in the server explorer.
I have checked that the services are running, I've restarted them also just in case.
Any ideas would be much appreciated.
Regards,
Derek
Hello derek
I got the same problem yesterday and the solution to this problem is to right click on the project in solution explorer.say MovieSample is a project right click on it and then go to Properties.In properties on th left hand side select deployment and change the server name.By default the server name is localHost so replace it with your machine name and then instance of sql server 2005 like aliraza/sqlserver2005.
try this and i am pretty sure that this will work fine for you.
ali
|||This post looks old but for those of you just looking now you might also try making sure you have Analysis Services started.|||Hi,
What is Analysis Serves? How can I start it? And I entered my server name but still it is saying me same error. Error 1 The project could not be deployed to the 'xxxx(my server name)' server because of the following connectivity problems : A connection cannot be made. Ensure that the server is running. To verify or update the name of the target server, right-click on the project in Solution Explorer, select Project Properties, click on the Deployment tab, and then enter the name of the server.
I am totally new in this area..
Please solve it.. Thanks.
|||
Hi,
1.Make sure you have entered the server name correctly and
2.if you are connecting to a remote server its fine or if you are connecting to the SSAS through http then you may have to configure that(hit google 4 more help)
I think in your case the SSAS service is not started,mostly SSAS service when installed is tagged as 'manual'
so please 'start' the SSAS service and try deploying !!
|||I'm having the similar problem as stated above. how bout i've got both SSAS running already but still doesnt seems working. what should I do?|||In solutions Explorer
Click Name of the project and right click and go to properties.Expand Configuration Properties and click deployment.Change the server to the correct name of the server with any instance.
Expand Data Sources and double click your data source.Go to imprsonate Information and check use a specific user name and password radio button and enter domain user having sysadmin rights of your database and password.
Analysis Services Project - A connection cannot be made. Ensure the server is running.
Hi there
I have created an Analysis services project on a laptop running developer edition SQL 2005. The database is hosted on the local machine. When I attempt to debug or deploy the project I get an error;
Error 1 The project could not be deployed to the 'localhost' server because of the following connectivity problems : A connection cannot be made. Ensure that the server is running. To verify or update the name of the target server, right-click on the project in Solution Explorer, select Project Properties, click on the Deployment tab, and then enter the name of the server.
It seems bizarre as I can view tables, create dimensions, cubes etc also I have database as a connection in the server explorer.
I have checked that the services are running, I've restarted them also just in case.
Any ideas would be much appreciated.
Regards,
Derek
Hello derek
I got the same problem yesterday and the solution to this problem is to right click on the project in solution explorer.say MovieSample is a project right click on it and then go to Properties.In properties on th left hand side select deployment and change the server name.By default the server name is localHost so replace it with your machine name and then instance of sql server 2005 like aliraza/sqlserver2005.
try this and i am pretty sure that this will work fine for you.
ali
|||This post looks old but for those of you just looking now you might also try making sure you have Analysis Services started.|||Hi,
What is Analysis Serves? How can I start it? And I entered my server name but still it is saying me same error. Error 1 The project could not be deployed to the 'xxxx(my server name)' server because of the following connectivity problems : A connection cannot be made. Ensure that the server is running. To verify or update the name of the target server, right-click on the project in Solution Explorer, select Project Properties, click on the Deployment tab, and then enter the name of the server.
I am totally new in this area..
Please solve it.. Thanks.
|||
Hi,
1.Make sure you have entered the server name correctly and
2.if you are connecting to a remote server its fine or if you are connecting to the SSAS through http then you may have to configure that(hit google 4 more help)
I think in your case the SSAS service is not started,mostly SSAS service when installed is tagged as 'manual'
so please 'start' the SSAS service and try deploying !!
|||I'm having the similar problem as stated above. how bout i've got both SSAS running already but still doesnt seems working. what should I do?|||In solutions Explorer
Click Name of the project and right click and go to properties.Expand Configuration Properties and click deployment.Change the server to the correct name of the server with any instance.
Expand Data Sources and double click your data source.Go to imprsonate Information and check use a specific user name and password radio button and enter domain user having sysadmin rights of your database and password.
Analysis Services Project - A connection cannot be made. Ensure the server is running.
Hi there
I have created an Analysis services project on a laptop running developer edition SQL 2005. The database is hosted on the local machine. When I attempt to debug or deploy the project I get an error;
Error 1 The project could not be deployed to the 'localhost' server because of the following connectivity problems : A connection cannot be made. Ensure that the server is running. To verify or update the name of the target server, right-click on the project in Solution Explorer, select Project Properties, click on the Deployment tab, and then enter the name of the server.
It seems bizarre as I can view tables, create dimensions, cubes etc also I have database as a connection in the server explorer.
I have checked that the services are running, I've restarted them also just in case.
Any ideas would be much appreciated.
Regards,
Derek
Hello derek
I got the same problem yesterday and the solution to this problem is to right click on the project in solution explorer.say MovieSample is a project right click on it and then go to Properties.In properties on th left hand side select deployment and change the server name.By default the server name is localHost so replace it with your machine name and then instance of sql server 2005 like aliraza/sqlserver2005.
try this and i am pretty sure that this will work fine for you.
ali
|||This post looks old but for those of you just looking now you might also try making sure you have Analysis Services started.|||Hi,
What is Analysis Serves? How can I start it? And I entered my server name but still it is saying me same error. Error 1 The project could not be deployed to the 'xxxx(my server name)' server because of the following connectivity problems : A connection cannot be made. Ensure that the server is running. To verify or update the name of the target server, right-click on the project in Solution Explorer, select Project Properties, click on the Deployment tab, and then enter the name of the server.
I am totally new in this area..
Please solve it.. Thanks.
|||
Hi,
1.Make sure you have entered the server name correctly and
2.if you are connecting to a remote server its fine or if you are connecting to the SSAS through http then you may have to configure that(hit google 4 more help)
I think in your case the SSAS service is not started,mostly SSAS service when installed is tagged as 'manual'
so please 'start' the SSAS service and try deploying !!
|||I'm having the similar problem as stated above. how bout i've got both SSAS running already but still doesnt seems working. what should I do?|||In solutions Explorer
Click Name of the project and right click and go to properties.Expand Configuration Properties and click deployment.Change the server to the correct name of the server with any instance.
Expand Data Sources and double click your data source.Go to imprsonate Information and check use a specific user name and password radio button and enter domain user having sysadmin rights of your database and password.
Analysis Services Project - A connection cannot be made. Ensure the server is running.
Hi there
I have created an Analysis services project on a laptop running developer edition SQL 2005. The database is hosted on the local machine. When I attempt to debug or deploy the project I get an error;
Error 1 The project could not be deployed to the 'localhost' server because of the following connectivity problems : A connection cannot be made. Ensure that the server is running. To verify or update the name of the target server, right-click on the project in Solution Explorer, select Project Properties, click on the Deployment tab, and then enter the name of the server.
It seems bizarre as I can view tables, create dimensions, cubes etc also I have database as a connection in the server explorer.
I have checked that the services are running, I've restarted them also just in case.
Any ideas would be much appreciated.
Regards,
Derek
Hello derek
I got the same problem yesterday and the solution to this problem is to right click on the project in solution explorer.say MovieSample is a project right click on it and then go to Properties.In properties on th left hand side select deployment and change the server name.By default the server name is localHost so replace it with your machine name and then instance of sql server 2005 like aliraza/sqlserver2005.
try this and i am pretty sure that this will work fine for you.
ali
|||This post looks old but for those of you just looking now you might also try making sure you have Analysis Services started.|||Hi,
What is Analysis Serves? How can I start it? And I entered my server name but still it is saying me same error. Error 1 The project could not be deployed to the 'xxxx(my server name)' server because of the following connectivity problems : A connection cannot be made. Ensure that the server is running. To verify or update the name of the target server, right-click on the project in Solution Explorer, select Project Properties, click on the Deployment tab, and then enter the name of the server.
I am totally new in this area..
Please solve it.. Thanks.
|||
Hi,
1.Make sure you have entered the server name correctly and
2.if you are connecting to a remote server its fine or if you are connecting to the SSAS through http then you may have to configure that(hit google 4 more help)
I think in your case the SSAS service is not started,mostly SSAS service when installed is tagged as 'manual'
so please 'start' the SSAS service and try deploying !!
|||I'm having the similar problem as stated above. how bout i've got both SSAS running already but still doesnt seems working. what should I do?|||In solutions Explorer
Click Name of the project and right click and go to properties.Expand Configuration Properties and click deployment.Change the server to the correct name of the server with any instance.
Expand Data Sources and double click your data source.Go to imprsonate Information and check use a specific user name and password radio button and enter domain user having sysadmin rights of your database and password.
Sunday, February 12, 2012
Analysis Services Cube Editor
s
that by default only inner joins are created and to use Visual Database Tool
s
( a Visual Studio module). Any workarounds for this?
thanks in advanceThe most flexible way to do this is to create a view on the relational
database-side.
Analysis Services loads from a view as well as it can from a base table.
Remember however, that you should explicitly cast NULLs to specific values
from the outer join.
Analysis Services treats NULLs as 0's (in measures) and as unknown values
(as dimension keys).
In SQL Server 2005, we have expanded the semantics for handling NULLs, but
for now in SQL Server 2000, we strongly recommend that you specifically cast
NULLs to some pre-defined value prior to exposing the data to Analysis
Services. You will just be a lot happier if you do this.
Hope that helps.
--
Dave Wickert [MSFT]
dwickert@.online.microsoft.com
Program Manager
BI SystemsTeam
SQL BI Product Unit (Analysis Services)
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Homer" <Homer@.discussions.microsoft.com> wrote in message
news:8C2079B0-3156-485E-94B4-86A0A7A1F019@.microsoft.com...
> How does one create outer joins in the cube editor. The documentation
states
> that by default only inner joins are created and to use Visual Database
Tools
> ( a Visual Studio module). Any workarounds for this?
> thanks in advance
Analysis Services Cube Editor
that by default only inner joins are created and to use Visual Database Tools
( a Visual Studio module). Any workarounds for this?
thanks in advance
The most flexible way to do this is to create a view on the relational
database-side.
Analysis Services loads from a view as well as it can from a base table.
Remember however, that you should explicitly cast NULLs to specific values
from the outer join.
Analysis Services treats NULLs as 0's (in measures) and as unknown values
(as dimension keys).
In SQL Server 2005, we have expanded the semantics for handling NULLs, but
for now in SQL Server 2000, we strongly recommend that you specifically cast
NULLs to some pre-defined value prior to exposing the data to Analysis
Services. You will just be a lot happier if you do this.
Hope that helps.
Dave Wickert [MSFT]
dwickert@.online.microsoft.com
Program Manager
BI SystemsTeam
SQL BI Product Unit (Analysis Services)
This posting is provided "AS IS" with no warranties, and confers no rights.
"Homer" <Homer@.discussions.microsoft.com> wrote in message
news:8C2079B0-3156-485E-94B4-86A0A7A1F019@.microsoft.com...
> How does one create outer joins in the cube editor. The documentation
states
> that by default only inner joins are created and to use Visual Database
Tools
> ( a Visual Studio module). Any workarounds for this?
> thanks in advance
Analysis services connection problem
Hi,
I created a shared datasoure to point to a remote AS server, when I clicked "Test Connection" it succeeds.
I used the query builder to create an MDX query by dragging items from the cube, the results appear in the right hand paine when I do this which tells me that I am connecting to the cube successfully. I then finish the wizard which creates my report.
The problem comes when I click "Preview", I get the following error message:
An error occurred during local report processing.
An error occurred during report processing.
Cannot create a connection to data source 'SalesMartCube'
A connection cannot be made. Ensure that the server is running.
No connection could be made because the target machine actively refused it.
Why would I be able to see the query results in query builder but not when I preview the report?
Thanks,
Lachlan
Hi,
Did you have any joy with this as i am getting exactly the same problem?
Any advice would help.
Thanks
Analysis services connection from Data Source
Hello everybody.
I want to perform a Analysis Services Processing Task using a connection manager created from a Analysis Services data source. I create the data source using the Oledb provider for Analysis Services 9.0, and it works fine. Then I create a connection manager using the "New connection from data source" option, and it seems to create it ok.
The problem is that I can't then asign this connection to the Analysis Services processing task. I get the error:
"Connection Manager MyConectionManagerFromDataSource is not a Analysis Services Connection Manager"
However, if I create directly a connection manager using "New Analysis Services Connection" it works fine.
Is it at all possible to create a Analysis services connection from a Data Source to perform a Analysis Services Processing Task?
Thanks in advance,
Check the two Connection Manager that you have created. There must be some difference between them.
-Jamie
|||
Thanks Jamie.
I've been checking the connection strings, and there is a slight difference:
Analysis services connection manager:
Data Source=myserver;Initial Catalog=mycatalog;Provider=MSOLAP.3;Integrated Security=SSPI;Impersonation Level=Impersonate;
Connection manager from data source:
Provider=MSOLAP.3;Data Source=myserver;Integrated Security=SSPI;Initial Catalog=mycatalog;Impersonation Level=3
I've tried to change the Impersonation Level to Impersonate in the Data Source, but only integer values are alowed.
Also, in the connection manager type, I have MSOLAP90 for the AS connection manager, and OLEDB for the CM from Data source. I think this must be the issue, but I'm not able to change the connection manager type
Thanks again,
Thursday, February 9, 2012
Analysis Services 2005 Cubes
Hi,
I had designed the DW database like
1. For each report one fact and some dimensions are created
2. Now i want to create a cube. while creating a cube i got some doubts. i want to know that what is the better way to create a cube
2.1 Whether i have to use one cube for one report
or
2.2 Whether i have to create only one cube and i have to create different measures
Doubts:
1. If i go to option 2.1 then it takes more memory? (because each cube stores the data in structres)
2. if i go to option 2.2 then it hits performance? (because several users access several reports using the same cube)
Can you please help me in this.
Thanks
Dinesh
If you have common structures between your reports you will probably get much better performance and memory useage from haveing multiple measures in a single cube rather than a cube per report. The indexes and caching could all be shared between the measures increasing the performance.|||Thanks.