Showing posts with label errors. Show all posts
Showing posts with label errors. Show all posts

Thursday, March 22, 2012

count + excludeempty gives errors

Hi,

I try to make a calculated cell in SSAS 2000, in the standard foodmart 2000 example.
I try a technique from the following page:
http://msdn2.microsoft.com/en-us/library/aa902637(SQL.80).aspx

For instance, I want to know how many married people there are in a salarygroup in the cube 'Sales'.
I define the following MDX instruction for the calculated member "Married customers":
Count(CrossJoin( {[Marital Status].[M]},
Descendants([Customers].CurrentMember, [Customers].[(All)])), excludeempty)
I get nothing but errors when browsing the cube. Every cell states #ERR
When I do not define 'excludeempty' everything's fine.
How come?

Thanks in advance
I have to guess here, because you don't specify the entire statement, but I am pretty sure that the #ERR that you are getting is "Infinite recursion" one. Which dimension did you define the "Married customers" calculated member ? If in measures - you will get this error. So either you move the calculated member to the Customers dimension, or you explicitly qualify your set with one of the cube measures for which you want to do math.|||Yes, I have defined it in measures.

As I, for instance, execute the following query in the MDX Sample Application (in the foodmart2000 example) I get these errors too:

WITH MEMBER [Measures].[allcustom] AS 'COUNT([Customers].[Name].MEMBERS, excludeEmpty)'
SELECT
[Gender].MEMBERS ON COLUMNS,
[Yearly Income].MEMBERS ON ROWS
FROM Sales
WHERE [Measures].[allcustom]

If I, for instance, make two calculated cells where I calculate the amount of male and female customers, like as follows:
COUNT(NonEmptyCrossjoin(
{[Customers].[Name].MEMBERS},

{ [Gender].[Gender].&[M] }
))
COUNT(NonEmptyCrossjoin(
{[Customers].[Name].MEMBERS},

{ [Gender].[Gender].&[F] }
))
And I execute the following query in the MDX sample application:
SELECT
[Yearly Income].MEMBERS ON COLUMNS,
{ [Measures].[Male customers], [Measures].[female customers]} ON ROWS
FROM Sales

With this, I get a similar result as what I wanted in first query in this post.
But I do not want to make calculated cells for every member of a dimension.
But how do I make one calculated cell for that?

Thanks,

Eyso
|||Thanks mister Pasumansky! It works great. :)
I didn't knew that if I changed the parent dimension of a calculated member, I could still get the counts as results rather than as metadata.

count + excludeempty gives errors

Hi,

I try to make a calculated cell in SSAS 2000, in the standard foodmart 2000 example.
I try a technique from the following page:
http://msdn2.microsoft.com/en-us/library/aa902637(SQL.80).aspx

For instance, I want to know how many married people there are in a salarygroup in the cube 'Sales'.
I define the following MDX instruction for the calculated member "Married customers":
Count(CrossJoin( {[Marital Status].[M]},
Descendants([Customers].CurrentMember, [Customers].[(All)])), excludeempty)
I get nothing but errors when browsing the cube. Every cell states #ERR
When I do not define 'excludeempty' everything's fine.
How come?

Thanks in advanceI have to guess here, because you don't specify the entire statement, but I am pretty sure that the #ERR that you are getting is "Infinite recursion" one. Which dimension did you define the "Married customers" calculated member ? If in measures - you will get this error. So either you move the calculated member to the Customers dimension, or you explicitly qualify your set with one of the cube measures for which you want to do math.|||Yes, I have defined it in measures.

As I, for instance, execute the following query in the MDX Sample Application (in the foodmart2000 example) I get these errors too:

WITH MEMBER [Measures].[allcustom] AS 'COUNT([Customers].[Name].MEMBERS, excludeEmpty)'
SELECT
[Gender].MEMBERS ON COLUMNS,
[Yearly Income].MEMBERS ON ROWS
FROM Sales
WHERE [Measures].[allcustom]

If I, for instance, make two calculated cells where I calculate the amount of male and female customers, like as follows:
COUNT(NonEmptyCrossjoin(
{[Customers].[Name].MEMBERS},

{ [Gender].[Gender].&[M] }
))
COUNT(NonEmptyCrossjoin(
{[Customers].[Name].MEMBERS},

{ [Gender].[Gender].&[F] }
))
And I execute the following query in the MDX sample application:
SELECT
[Yearly Income].MEMBERS ON COLUMNS,
{ [Measures].[Male customers], [Measures].[female customers]} ON ROWS
FROM Sales

With this, I get a similar result as what I wanted in first query in this post.
But I do not want to make calculated cells for every member of a dimension.
But how do I make one calculated cell for that?

Thanks,

Eyso|||Thanks mister Pasumansky! It works great. :)
I didn't knew that if I changed the parent dimension of a calculated member, I could still get the counts as results rather than as metadata.

Tuesday, March 20, 2012

Could this SP be causing Timeout errors

The other day I had added a little call to a proc that logged
the adds or updates to several tables. I wanted to do this to tell who made
changes to the records in case we have an issue down the road. After putting
this change in I started to really have a major problems with the system
slowing down. Here is some the tables and procs:
Table TableLog:
MessageId int
Message varchar 500
MessageDate datetime
AppLoggedInUser varchar 100
ComputerName varchar 100
CompLoggedInUser varchar 100
Proc to add new entries:
CREATE PROCEDURE [dbo].[AddTableLog]
@.Message varchar(500),
@.AppLoggedInUser varchar(100),
@.ComputerName varchar(100)
AS
Insert into TableLogs( Message, MessageDate, AppLoggedInUser, ComputerName,
CompLoggedInUser)
Values( @.Message, GetDate(), @.AppLoggedInUser, @.ComputerName, Session_User )
GO
How the above proc is used:
CREATE PROCEDURE [dbo].[nf_AddAttendanceV3_1]
@.PatientId varchar(20),
@.AttendDate datetime,
@.C_ID int,
@.GroupTime varchar(8),
@.Diagnostic tinyint,
@.Program tinyint,
@.AttendedGroup tinyint,
@.DocId int,
@.GroupId int,
@.GroupType Tinyint,
@.ComputerName varchar(100),
@.LoggedInUser varchar(100)
AS
Insert into Attendance (PatientId, AttendDate, C_ID, GroupTime, Diagnostic,
Program, AttendedGroup, GroupType, GroupId, DocId ,CreationDate,
UpdatedBy,ComputerName, LoggedInUser)
values(@.PatientId, @.AttendDate, @.C_ID, @.GroupTime, @.Diagnostic, @.Program,
@.AttendedGroup, @.GroupType, @.GroupId, @.DocId , GetDate(),
Session_User,@.ComputerName, @.LoggedInUser)
Declare @.UserMessage Varchar(500)
select @.UserMessage = 'User ' + @.LoggedInUser + ' has added a attendance
record for PatientId: ' + @.PatientId + ' for attendDate: ' + @.AttendDate
Exec AddTableLog @.UserMessage, @.LoggedInUser, @.ComputerName
GO
Does this look like it could cause the slow down in the system. I backed out
most of the procs that had the call to the Log table, but still have the
issue. If you think this is causing the issue with slow downs or locks, is
there a better way to do this. THanks for any suggestions.
MichaelHope this helps a bit:-
http://omnibuzz-sql.blogspot.com/2006/11/parameter-sniffing-stored-procedures.html
Manu Jaidka
"Michael" wrote:
> The other day I had added a little call to a proc that logged
> the adds or updates to several tables. I wanted to do this to tell who made
> changes to the records in case we have an issue down the road. After putting
> this change in I started to really have a major problems with the system
> slowing down. Here is some the tables and procs:
> Table TableLog:
> MessageId int
> Message varchar 500
> MessageDate datetime
> AppLoggedInUser varchar 100
> ComputerName varchar 100
> CompLoggedInUser varchar 100
> Proc to add new entries:
> CREATE PROCEDURE [dbo].[AddTableLog]
> @.Message varchar(500),
> @.AppLoggedInUser varchar(100),
> @.ComputerName varchar(100)
> AS
> Insert into TableLogs( Message, MessageDate, AppLoggedInUser, ComputerName,
> CompLoggedInUser)
> Values( @.Message, GetDate(), @.AppLoggedInUser, @.ComputerName, Session_User )
> GO
> How the above proc is used:
> CREATE PROCEDURE [dbo].[nf_AddAttendanceV3_1]
> @.PatientId varchar(20),
> @.AttendDate datetime,
> @.C_ID int,
> @.GroupTime varchar(8),
> @.Diagnostic tinyint,
> @.Program tinyint,
> @.AttendedGroup tinyint,
> @.DocId int,
> @.GroupId int,
> @.GroupType Tinyint,
> @.ComputerName varchar(100),
> @.LoggedInUser varchar(100)
> AS
> Insert into Attendance (PatientId, AttendDate, C_ID, GroupTime, Diagnostic,
> Program, AttendedGroup, GroupType, GroupId, DocId ,CreationDate,
> UpdatedBy,ComputerName, LoggedInUser)
> values(@.PatientId, @.AttendDate, @.C_ID, @.GroupTime, @.Diagnostic, @.Program,
> @.AttendedGroup, @.GroupType, @.GroupId, @.DocId , GetDate(),
> Session_User,@.ComputerName, @.LoggedInUser)
> Declare @.UserMessage Varchar(500)
> select @.UserMessage = 'User ' + @.LoggedInUser + ' has added a attendance
> record for PatientId: ' + @.PatientId + ' for attendDate: ' + @.AttendDate
> Exec AddTableLog @.UserMessage, @.LoggedInUser, @.ComputerName
> GO
> Does this look like it could cause the slow down in the system. I backed out
> most of the procs that had the call to the Log table, but still have the
> issue. If you think this is causing the issue with slow downs or locks, is
> there a better way to do this. THanks for any suggestions.
> Michael
>

Monday, March 19, 2012

could not open FCB...

I have a DB with 4 tables with errors.
If I do a SELECT count(*) on this tables, works ok
but if I do a SELECT * on this tables, the following
message appears:
Could not open FCB for invalid file ID 0 in database
I tried to drop the indexes ... no problem
I tried to create the indexes .. don't work the same error
appears.
Can I fix the problem ?
ThanksSounds like the indexes are OK, but the data table is corrupt... Run DBCC
checktable on the table... you may have to restore from the last known good
backup...
You may need to open a call to MS (FCB stands for File Control Block I
beleive)
Wayne Snyder MCDBA, SQL Server MVP
Computer Education Services Corp (CESC), Charlotte, NC
(Please respond only to the newsgroups.)
PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org
"Pablo" <ppastormerlo@.lpa.com.ar> wrote in message
news:091e01c36bf4$cd0895b0$a001280a@.phx.gbl...
> I have a DB with 4 tables with errors.
> If I do a SELECT count(*) on this tables, works ok
> but if I do a SELECT * on this tables, the following
> message appears:
> Could not open FCB for invalid file ID 0 in database
> I tried to drop the indexes ... no problem
> I tried to create the indexes .. don't work the same error
> appears.
> Can I fix the problem ?
> Thanks

Could not open FCB for invalid file ID 46336 in database 'Production'..

For about two hours last evening our database started producing these errors
and various jobs failed.
This morning all seems quiet. However we do rebuild our indexes overnight.
Should we worry about this?
The jobs that failed do not process any text columns (the only mention I
found on microsofts site).
The File ID cannot relate to sysfiles. Does anyone know what is does relate
to?
SQL Server 2000 SP3A.Hi
Please run DBCC checktable to see if there are any corruption related errors on this table. Take full database backup before you execute dbcc checktable.
If the output come clear then you do not want to worry any more
Thank
Har
MCDB
-- Paul Cahill wrote: --
For about two hours last evening our database started producing these error
and various jobs failed
This morning all seems quiet. However we do rebuild our indexes overnight
Should we worry about this
The jobs that failed do not process any text columns (the only mention
found on microsofts site)
The File ID cannot relate to sysfiles. Does anyone know what is does relat
to
SQL Server 2000 SP3A|||Thanks Hari
How do I tell which table. I tried offering up the number above as an ID to
sysobjects but nothing came back.
Paul
"Hari" <hari_prasad_k@.hotmail.com> wrote in message
news:F3226200-D6DC-4939-8773-4E5CFC0FA567@.microsoft.com...
> Hi,
> Please run DBCC checktable to see if there are any corruption related
errors on this table. Take full database backup before you execute dbcc
checktable.
> If the output come clear then you do not want to worry any more.
> Thanks
> Hari
> MCDBA
>
> -- Paul Cahill wrote: --
> For about two hours last evening our database started producing these
errors
> and various jobs failed.
> This morning all seems quiet. However we do rebuild our indexes
overnight.
> Should we worry about this?
> The jobs that failed do not process any text columns (the only
mention I
> found on microsofts site).
> The File ID cannot relate to sysfiles. Does anyone know what is does
relate
> to?
> SQL Server 2000 SP3A.
>
>|||Hi,
I feel that it should be a problem with tempdb. If it is the case no issues.
Anyway can you execute DBCC CHECKDB('dbname') for that database and ensure
no errors.
Thanks
Hari
MCDBA
"Paul Cahill" <XYZpaul.cahillXYZ@.blueyonder.co.uk> wrote in message
news:O0Ga6aBNEHA.2844@.tk2msftngp13.phx.gbl...
> Thanks Hari
> How do I tell which table. I tried offering up the number above as an ID
to
> sysobjects but nothing came back.
> Paul
>
> "Hari" <hari_prasad_k@.hotmail.com> wrote in message
> news:F3226200-D6DC-4939-8773-4E5CFC0FA567@.microsoft.com...
> > Hi,
> >
> > Please run DBCC checktable to see if there are any corruption related
> errors on this table. Take full database backup before you execute dbcc
> checktable.
> > If the output come clear then you do not want to worry any more.
> >
> > Thanks
> > Hari
> > MCDBA
> >
> >
> > -- Paul Cahill wrote: --
> >
> > For about two hours last evening our database started producing
these
> errors
> > and various jobs failed.
> > This morning all seems quiet. However we do rebuild our indexes
> overnight.
> > Should we worry about this?
> >
> > The jobs that failed do not process any text columns (the only
> mention I
> > found on microsofts site).
> >
> > The File ID cannot relate to sysfiles. Does anyone know what is
does
> relate
> > to?
> >
> > SQL Server 2000 SP3A.
> >
> >
> >
>|||I was starting to suspect as much.
Let's just assume this never happened :)
Paul
"Hari" <hari_prasad_k@.hotmail.com> wrote in message
news:Oom$kfBNEHA.3420@.TK2MSFTNGP11.phx.gbl...
> Hi,
> I feel that it should be a problem with tempdb. If it is the case no
issues.
> Anyway can you execute DBCC CHECKDB('dbname') for that database and ensure
> no errors.
> Thanks
> Hari
> MCDBA
>
> "Paul Cahill" <XYZpaul.cahillXYZ@.blueyonder.co.uk> wrote in message
> news:O0Ga6aBNEHA.2844@.tk2msftngp13.phx.gbl...
> > Thanks Hari
> >
> > How do I tell which table. I tried offering up the number above as an ID
> to
> > sysobjects but nothing came back.
> >
> > Paul
> >
> >
> >
> > "Hari" <hari_prasad_k@.hotmail.com> wrote in message
> > news:F3226200-D6DC-4939-8773-4E5CFC0FA567@.microsoft.com...
> > > Hi,
> > >
> > > Please run DBCC checktable to see if there are any corruption related
> > errors on this table. Take full database backup before you execute dbcc
> > checktable.
> > > If the output come clear then you do not want to worry any more.
> > >
> > > Thanks
> > > Hari
> > > MCDBA
> > >
> > >
> > > -- Paul Cahill wrote: --
> > >
> > > For about two hours last evening our database started producing
> these
> > errors
> > > and various jobs failed.
> > > This morning all seems quiet. However we do rebuild our indexes
> > overnight.
> > > Should we worry about this?
> > >
> > > The jobs that failed do not process any text columns (the only
> > mention I
> > > found on microsofts site).
> > >
> > > The File ID cannot relate to sysfiles. Does anyone know what is
> does
> > relate
> > > to?
> > >
> > > SQL Server 2000 SP3A.
> > >
> > >
> > >
> >
> >
>

Tuesday, February 14, 2012

Corrupted sysindexes

After running the command dbcc checkdb, which is part of a weekly job the following returned
CHECKDB found 1 allocation errors and 957 consistency errors in table 'sysindexes' (object ID 2).
Any ideas on how to fixed this sysindexes table.
I've run dbcc updateusage, dbbc reindex on all tables, dbbc checkdb
Considering it is sysindexes, my guess you are in for a restore. If that isn't convenient, opening a case with
MS is probably a good idea (but chances are that they don't have better options either). General
recommendations for corrupt or suspect databases: http://www.karaszi.com/sqlserver/inf...suspect_db.asp
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"Stephen" <stephen.hoye@.tabq.com.au> wrote in message
news:89575553-91E2-459B-B6CD-0709E5C79463@.microsoft.com...
> After running the command dbcc checkdb, which is part of a weekly job the following returned
> CHECKDB found 1 allocation errors and 957 consistency errors in table 'sysindexes' (object ID 2).
> Any ideas on how to fixed this sysindexes table.
> I've run dbcc updateusage, dbbc reindex on all tables, dbbc checkdb
>
|||I'm going to create a DTS package and move the database over to anthor DB.
Then I'l rename them. We do have back up, but the problem was picked up after I long weekend.
There was no going back because a number of days had pasted.
Doing the above DTS method, there is no loss in data.

Corrupted sysindexes

After running the command dbcc checkdb, which is part of a weekly job the following returne
CHECKDB found 1 allocation errors and 957 consistency errors in table 'sysindexes' (object ID 2)
Any ideas on how to fixed this sysindexes table.
I've run dbcc updateusage, dbbc reindex on all tables, dbbc checkdConsidering it is sysindexes, my guess you are in for a restore. If that isn't convenient, opening a case with
MS is probably a good idea (but chances are that they don't have better options either). General
recommendations for corrupt or suspect databases: http://www.karaszi.com/sqlserver/info_corrupt_suspect_db.asp
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"Stephen" <stephen.hoye@.tabq.com.au> wrote in message
news:89575553-91E2-459B-B6CD-0709E5C79463@.microsoft.com...
> After running the command dbcc checkdb, which is part of a weekly job the following returned
> CHECKDB found 1 allocation errors and 957 consistency errors in table 'sysindexes' (object ID 2).
> Any ideas on how to fixed this sysindexes table.
> I've run dbcc updateusage, dbbc reindex on all tables, dbbc checkdb
>|||I'm going to create a DTS package and move the database over to anthor DB
Then I'l rename them. We do have back up, but the problem was picked up after I long weekend
There was no going back because a number of days had pasted
Doing the above DTS method, there is no loss in data.