SQL Server Triggers- New Person -Help Required-Urgent
Mar 10, 2008
Please help me in sorting out my Problem Providing me the solution .
My Problem is
I have a master table with Primary key on ID field (PatientID-(Patient-Table)) and it is an Identity field
And My child table has the same ID field(PatientID-(PatientDetails-Table)) and it has the relationship set
And the child table has its own Primary key of its own ID field(PatientdetailsID).
What I want is as soon as enter row of data into the master table (Patient-Table)and click save on my front end application(Which is ASP.Net web application)
I want to update Child Table’S (PatientDetails)ID field ( ie.,PaientID in the PatientDetailsTable) in the Child Table which relates the parent table ,by doing so I want to update the Primary key field (ie.,PatientDetailsID) & ForeignKey Field (PatientID)of the child table and to create row in the child table with two columns .(PatientID,&PatientDetailsID)
What I want to achieve is in my ASP.net Application as soon as I enter Master table
I want to Edit Child tables (about 15) one by one like a Wizard pages which will have The ID Field(PatientID) same in all my wizard pages .
I want to know whether I can incorporate triggers if so in which table (is it in Patient or PatientDetails) and I will be grateful If anyone gives the Script to-do so.I am also providing my two table sripts.
Sripts:CREATE TABLE [dbo].[Patient]( [PatientID] [int] IDENTITY(1,1) NOT NULL, [Date] [smalldatetime] NULL, [UserID] [int] NULL, [FirstName] [varchar](40) NOT NULL, [Surname] [varchar](30) NOT NULL, [DOB] [datetime] NULL, [Age] AS (floor(datediff(day,[DOB],getdate())/(365.25))), [Sex] [varchar](10) NULL, [Occupation] [varchar](30) NULL, [Ethinicity] [varchar](60) NULL, [HomeTel] [varchar](15) NULL, [Mobile] [varchar](15) NULL, [varchar](40) NULL, [AddressLine1] [varchar](30) NULL, [Line2] [varchar](30) NULL, [Line3] [varchar](30) NULL, [City] [varchar](20) NULL, [PostCode] [varchar](15) NULL, CONSTRAINT [PK_Patient] PRIMARY KEY CLUSTERED ( [PatientID] ASC)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]) ON [PRIMARY] GOSET ANSI_PADDING OFFGOALTER TABLE [dbo].[Patient] WITH CHECK ADD CONSTRAINT [FK_Patient_User] FOREIGN KEY([UserID])REFERENCES [dbo].[User] ([UserID])GOALTER TABLE [dbo].[Patient] CHECK CONSTRAINT [FK_Patient_User] CREATE TABLE [dbo].[PatientDetails]( [PatientID] [int] NOT NULL, [PatientDetID] [int] IDENTITY(1,1) NOT NULL, [Date] [smalldatetime] NULL, [NHSNumber] [varchar](12) NULL, [HospitalRefID] [varchar](10) NULL, [Ovaries] [varchar](15) NULL, [ReportFromGP] [image] NULL, [LMP] [datetime] NULL, [DateStopped] [datetime] NULL, [Comment] [varchar](150) NULL, CONSTRAINT [PK_PatientDetails_1] PRIMARY KEY CLUSTERED ( [PatientDetID] ASC)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GOSET ANSI_PADDING OFFGOALTER TABLE [dbo].[PatientDetails] WITH CHECK ADD CONSTRAINT [FK_PatientDetails_Patient] FOREIGN KEY([PatientID])REFERENCES [dbo].[Patient] ([PatientID])GOALTER TABLE [dbo].[PatientDetails] CHECK CONSTRAINT [FK_PatientDetails_Patient]
I want to incorporate this through database level .
I am using SQL Server2005-Express
Although Iam using ASP.net C# I am new and I will not be able to do this in my front end.
Please help me wth the solution.
thanks
rameshs_2000
View 4 Replies
Nov 27, 2007
Hi, I need to your urgent help please...
My Event log is full of I/O Bad Page Id error meaages on MSDB database.
Here is Output of CHECKDB
Server: Msg 8909, Level 16, State 1, Line 1
Table error: Object ID 0, index ID 0, page ID (1:7845). The PageId in the page header = (0:0).
Server: Msg 8909, Level 16, State 1, Line 1
Table error: Object ID 0, index ID 0, page ID (1:7853). The PageId in the page header = (0:0).
Server: Msg 8909, Level 16, State 1, Line 1
Table error: Object ID 0, index ID 0, page ID (1:7854). The PageId in the page header = (0:0).
DBCC results for 'MSDB'.
CHECKDB found 0 allocation errors and 3 consistency errors not associated with any single object.
DBCC results for 'sysobjects'.
There are 533 rows in 9 pages for object 'sysobjects'.
DBCC results for 'sysindexes'.
There are 307 rows in 16 pages for object 'sysindexes'.
DBCC results for 'syscolumns'.
There are 3755 rows in 125 pages for object 'syscolumns'.
DBCC results for 'systypes'.
There are 26 rows in 1 pages for object 'systypes'.
DBCC results for 'syscomments'.
There are 495 rows in 176 pages for object 'syscomments'.
DBCC results for 'sysfiles1'.
There are 2 rows in 1 pages for object 'sysfiles1'.
DBCC results for 'syspermissions'.
There are 221 rows in 1 pages for object 'syspermissions'.
DBCC results for 'sysusers'.
There are 14 rows in 1 pages for object 'sysusers'.
DBCC results for 'sysproperties'.
There are 0 rows in 0 pages for object 'sysproperties'.
DBCC results for 'sysdepends'.
There are 3097 rows in 18 pages for object 'sysdepends'.
DBCC results for 'sysreferences'.
There are 33 rows in 1 pages for object 'sysreferences'.
DBCC results for 'sysfulltextcatalogs'.
There are 0 rows in 0 pages for object 'sysfulltextcatalogs'.
DBCC results for 'sysfulltextnotify'.
There are 0 rows in 0 pages for object 'sysfulltextnotify'.
Server: Msg 8928, Level 16, State 1, Line 1
Object ID 18099105, index ID 0: Page (1:7845) could not be processed. See other errors for details.
Server: Msg 8952, Level 16, State 1, Line 1
Table error: Database 'msdb', index 'sysdbmaintplan_history.UQ__sysdbmaintplan_h__41EDCAC5' (ID 1090102924) (index ID 2). Extra or invalid key for the keys:
Server: Msg 8956, Level 16, State 1, Line 1
Index row (1:7463:0) with values (sequence_id = 8296 and plan_id = 91AF9917-3C72-4FD2-BE43-98601416395E and ? = 24) points to the data row identified by ().
Server: Msg 8951, Level 16, State 1, Line 1
Table error: Table 'backupmediaset' (ID 2037582297). Missing or invalid key in index 'backupmediasetuuid' (ID 2) for the row:
Server: Msg 8955, Level 16, State 1, Line 1
Data row (1:7775:89) identified by (RID = (1:7775:89) media_set_id = 36388) has index values (media_uuid = 00000000-0000-0000-0000-000000000000 and media_set_id = NULL).
Server: Msg 8951, Level 16, State 1, Line 1
Table error: Table 'backupmediaset' (ID 2037582297). Missing or invalid key in index 'backupmediasetuuid' (ID 2) for the row:
Server: Msg 8955, Level 16, State 1, Line 1
Data row (1:7775:90) identified by (RID = (1:7775:90) media_set_id = 36389) has index values (media_uuid = 00000000-0000-0000-0000-000000000000 and media_set_id = NULL).
Server: Msg 8951, Level 16, State 1, Line 1
Table error: Table 'backupmediaset' (ID 2037582297). Missing or invalid key in index 'backupmediasetuuid' (ID 2) for the row:
Server: Msg 8955, Level 16, State 1, Line 1
Data row (1:7775:91) identified by (RID = (1:7775:91) media_set_id = 36390) has index values (media_uuid = 00000000-0000-0000-0000-000000000000 and media_set_id = NULL).
Server: Msg 8951, Level 16, State 1, Line 1
Table error: Table 'backupmediaset' (ID 2037582297). Missing or invalid key in index 'backupmediasetuuid' (ID 2) for the row:
Server: Msg 8955, Level 16, State 1, Line 1
Data row (1:7775:92) identified by (RID = (1:7775:92) media_set_id = 36391) has index values (media_uuid = 00000000-0000-0000-0000-000000000000 and media_set_id = NULL).
Server: Msg 8951, Level 16, State 1, Line 1
Table error: Table 'backupmediaset' (ID 2037582297). Missing or invalid key in index 'backupmediasetuuid' (ID 2) for the row:
Server: Msg 8955, Level 16, State 1, Line 1
Data row (1:7775:93) identified by (RID = (1:7775:93) media_set_id = 36392) has index values (media_uuid = 00000000-0000-0000-0000-000000000000 and media_set_id = NULL).
Server: Msg 8951, Level 16, State 1, Line 1
Table error: Table 'backupmediaset' (ID 2037582297). Missing or invalid key in index 'backupmediasetuuid' (ID 2) for the row:
Server: Msg 8955, Level 16, State 1, Line 1
Data row (1:7775:94) identified by (RID = (1:7775:94) media_set_id = 36393) has index values (media_uuid = 00000000-0000-0000-0000-000000000000 and media_set_id = NULL).
Server: Msg 8951, Level 16, State 1, Line 1
Table error: Table 'backupmediaset' (ID 2037582297). Missing or invalid key in index 'backupmediasetuuid' (ID 2) for the row:
Server: Msg 8955, Level 16, State 1, Line 1
Data row (1:7775:95) identified by (RID = (1:7775:95) media_set_id = 36394) has index values (media_uuid = 00000000-0000-0000-0000-000000000000 and media_set_id = NULL).
Server: Msg 8951, Level 16, State 1, Line 1
Table error: Table 'backupmediaset' (ID 2037582297). Missing or invalid key in index 'backupmediasetuuid' (ID 2) for the row:
Server: Msg 8955, Level 16, State 1, Line 1
Data row (1:7775:96) identified by (RID = (1:7775:96) media_set_id = 36395) has index values (media_uuid = 00000000-0000-0000-0000-000000000000 and media_set_id = NULL).
Server: Msg 8952, Level 16, State 1, Line 1
Table error: Database 'msdb', index 'backupmediafamily.backupmediafamilyuuid' (ID 2069582411) (index ID 2). Extra or invalid key for the keys:
Server: Msg 8956, Level 16, State 1, Line 1
Index row (1:1768:128) with values (media_family_id = 3988F04C-0000-0000-0000-000000000000 and media_set_id = 36415 and family_sequence_number = 2.121996171E-314) points to the data row identified by ().
Server: Msg 8952, Level 16, State 1, Line 1
Table error: Database 'msdb', index 'backupmediafamily.backupmediafamilyuuid' (ID 2069582411) (index ID 2). Extra or invalid key for the keys:
Server: Msg 8956, Level 16, State 1, Line 1
Index row (1:1773:225) with values (media_family_id = 8936C309-0000-0000-0000-000000000000 and media_set_id = 36406 and family_sequence_number = 2.121996171E-314) points to the data row identified by ().
Server: Msg 8952, Level 16, State 1, Line 1
Table error: Database 'msdb', index 'backupmediafamily.backupmediafamilyuuid' (ID 2069582411) (index ID 2). Extra or invalid key for the keys:
Server: Msg 8956, Level 16, State 1, Line 1
Index row (1:2080:143) with values (media_family_id = 3B7D0AD5-0000-0000-0000-000000000000 and media_set_id = 36419 and family_sequence_number = 9.778156605E-311) points to the data row identified by ().
Server: Msg 8952, Level 16, State 1, Line 1
Table error: Database 'msdb', index 'backupmediafamily.backupmediafamilyuuid' (ID 2069582411) (index ID 2). Extra or invalid key for the keys:
Server: Msg 8956, Level 16, State 1, Line 1
Index row (1:2081:47) with values (media_family_id = 61D32A3C-0000-0000-0000-000000000000 and media_set_id = 36417 and family_sequence_number = 9.778156605E-311) points to the data row identified by ().
Server: Msg 8952, Level 16, State 1, Line 1
Table error: Database 'msdb', index 'backupmediafamily.backupmediafamilyuuid' (ID 2069582411) (index ID 2). Extra or invalid key for the keys:
Server: Msg 8956, Level 16, State 1, Line 1
Index row (1:2081:234) with values (media_family_id = 6B23A43D-0000-0000-0000-000000000000 and media_set_id = 36402 and family_sequence_number = 9.778156605E-311) points to the data row identified by ().
Server: Msg 8952, Level 16, State 1, Line 1
Table error: Database 'msdb', index 'backupmediafamily.backupmediafamilyuuid' (ID 2069582411) (index ID 2). Extra or invalid key for the keys:
Server: Msg 8956, Level 16, State 1, Line 1
Index row (1:2082:148) with values (media_family_id = EBB5DD1C-0000-0000-0000-000000000000 and media_set_id = 36388 and family_sequence_number = 9.778156605E-311) points to the data row identified by ().
Server: Msg 8952, Level 16, State 1, Line 1
Table error: Database 'msdb', index 'backupmediafamily.backupmediafamilyuuid' (ID 2069582411) (index ID 2). Extra or invalid key for the keys:
Server: Msg 8956, Level 16, State 1, Line 1
Index row (1:2083:204) with values (media_family_id = 3C2E9566-0000-0000-0000-000000000000 and media_set_id = 36420 and family_sequence_number = 9.778156605E-311) points to the data row identified by ().
Server: Msg 8952, Level 16, State 1, Line 1
Table error: Database 'msdb', index 'backupmediafamily.backupmediafamilyuuid' (ID 2069582411) (index ID 2). Extra or invalid key for the keys:
Server: Msg 8956, Level 16, State 1, Line 1
Index row (1:2084:69) with values (media_family_id = 70907EEB-0000-0000-0000-000000000000 and media_set_id = 36401 and family_sequence_number = 9.778156605E-311) points to the data row identified by ().
Server: Msg 8952, Level 16, State 1, Line 1
Table error: Database 'msdb', index 'backupmediafamily.backupmediafamilyuuid' (ID 2069582411) (index ID 2). Extra or invalid key for the keys:
Server: Msg 8956, Level 16, State 1, Line 1
Index row (1:2085:1) with values (media_family_id = 2555E654-0000-0000-0000-000000000000 and media_set_id = 36413 and family_sequence_number = 9.778156605E-311) points to the data row identified by ().
Server: Msg 8952, Level 16, State 1, Line 1
Table error: Database 'msdb', index 'backupmediafamily.backupmediafamilyuuid' (ID 2069582411) (index ID 2). Extra or invalid key for the keys:
Server: Msg 8956, Level 16, State 1, Line 1
Index row (1:2087:141) with values (media_family_id = 93BAD469-0000-0000-0000-000000000000 and media_set_id = 36390 and family_sequence_number = 9.778156605E-311) points to the data row identified by ().
Server: Msg 8952, Level 16, State 1, Line 1
Table error: Database 'msdb', index 'backupmediafamily.backupmediafamilyuuid' (ID 2069582411) (index ID 2). Extra or invalid key for the keys:
Server: Msg 8956, Level 16, State 1, Line 1
Index row (1:2679:137) with values (media_family_id = A0682005-0000-0000-0000-000000000000 and media_set_id = 36397 and family_sequence_number = 9.778156605E-311) points to the data row identified by ().
Server: Msg 8952, Level 16, State 1, Line 1
Table error: Database 'msdb', index 'backupmediafamily.backupmediafamilyuuid' (ID 2069582411) (index ID 2). Extra or invalid key for the keys:
Server: Msg 8956, Level 16, State 1, Line 1
Index row (1:2776:82) with values (media_family_id = 6F12D425-0000-0000-0000-000000000000 and media_set_id = 36400 and family_sequence_number = 9.778156605E-311) points to the data row identified by ().
Server: Msg 8952, Level 16, State 1, Line 1
Table error: Database 'msdb', index 'backupmediafamily.backupmediafamilyuuid' (ID 2069582411) (index ID 2). Extra or invalid key for the keys:
Server: Msg 8956, Level 16, State 1, Line 1
Index row (1:2780:50) with values (media_family_id = 2C18BBCC-0000-0000-0000-000000000000 and media_set_id = 36412 and family_sequence_number = 9.778156605E-311) points to the data row identified by ().
Server: Msg 8952, Level 16, State 1, Line 1
Table error: Database 'msdb', index 'backupmediafamily.backupmediafamilyuuid' (ID 2069582411) (index ID 2). Extra or invalid key for the keys:
Server: Msg 8956, Level 16, State 1, Line 1
Index row (1:2782:159) with values (media_family_id = 79EDB994-0000-0000-0000-000000000000 and media_set_id = 36416 and family_sequence_number = 9.778156605E-311) points to the data row identified by ().
Server: Msg 8952, Level 16, State 1, Line 1
Table error: Database 'msdb', index 'backupmediafamily.backupmediafamilyuuid' (ID 2069582411) (index ID 2). Extra or invalid key for the keys:
Server: Msg 8956, Level 16, State 1, Line 1
Index row (1:2888:89) with values (media_family_id = D448D2F8-0000-0000-0000-000000000000 and media_set_id = 36410 and family_sequence_number = 9.778156605E-311) points to the data row identified by ().
Server: Msg 8952, Level 16, State 1, Line 1
Table error: Database 'msdb', index 'backupmediafamily.backupmediafamilyuuid' (ID 2069582411) (index ID 2). Extra or invalid key for the keys:
Server: Msg 8956, Level 16, State 1, Line 1
Index row (1:2889:75) with values (media_family_id = 992EE014-0000-0000-0000-000000000000 and media_set_id = 36404 and family_sequence_number = 9.778156605E-311) points to the data row identified by ().
Server: Msg 8952, Level 16, State 1, Line 1
Table error: Database 'msdb', index 'backupmediafamily.backupmediafamilyuuid' (ID 2069582411) (index ID 2). Extra or invalid key for the keys:
Server: Msg 8956, Level 16, State 1, Line 1
Index row (1:2892:32) with values (media_family_id = C2B9073E-0000-0000-0000-000000000000 and media_set_id = 36405 and family_sequence_number = 9.778156605E-311) points to the data row identified by ().
Server: Msg 8952, Level 16, State 1, Line 1
Table error: Database 'msdb', index 'backupmediafamily.backupmediafamilyuuid' (ID 2069582411) (index ID 2). Extra or invalid key for the keys:
Server: Msg 8956, Level 16, State 1, Line 1
Index row (1:2894:23) with values (media_family_id = 9B6D7F6A-0000-0000-0000-000000000000 and media_set_id = 36418 and family_sequence_number = 9.778156605E-311) points to the data row identified by ().
Server: Msg 8952, Level 16, State 1, Line 1
Table error: Database 'msdb', index 'backupmediafamily.backupmediafamilyuuid' (ID 2069582411) (index ID 2). Extra or invalid key for the keys:
Server: Msg 8956, Level 16, State 1, Line 1
Index row (1:3058:51) with values (media_family_id = 5726FBA4-0000-0000-0000-000000000000 and media_set_id = 36392 and family_sequence_number = 9.778156605E-311) points to the data row identified by ().
Server: Msg 8952, Level 16, State 1, Line 1
Table error: Database 'msdb', index 'backupmediafamily.backupmediafamilyuuid' (ID 2069582411) (index ID 2). Extra or invalid key for the keys:
Server: Msg 8956, Level 16, State 1, Line 1
Index row (1:3058:111) with values (media_family_id = 592F85A5-0000-0000-0000-000000000000 and media_set_id = 36422 and family_sequence_number = 9.778156605E-311) points to the data row identified by ().
Server: Msg 8952, Level 16, State 1, Line 1
Table error: Database 'msdb', index 'backupmediafamily.backupmediafamilyuuid' (ID 2069582411) (index ID 2). Extra or invalid key for the keys:
Server: Msg 8956, Level 16, State 1, Line 1
Index row (1:3637:228) with values (media_family_id = 288E49BA-0000-0000-0000-000000000000 and media_set_id = 36411 and family_sequence_number = 9.778156605E-311) points to the data row identified by ().
Server: Msg 8952, Level 16, State 1, Line 1
Table error: Database 'msdb', index 'backupmediafamily.backupmediafamilyuuid' (ID 2069582411) (index ID 2). Extra or invalid key for the keys:
Server: Msg 8956, Level 16, State 1, Line 1
Index row (1:3639:85) with values (media_family_id = B79996BD-0000-0000-0000-000000000000 and media_set_id = 36409 and family_sequence_number = 9.778156605E-311) points to the data row identified by ().
Server: Msg 8952, Level 16, State 1, Line 1
Table error: Database 'msdb', index 'backupmediafamily.backupmediafamilyuuid' (ID 2069582411) (index ID 2). Extra or invalid key for the keys:
Server: Msg 8956, Level 16, State 1, Line 1
Index row (1:3909:156) with values (media_family_id = 3AC0F52D-0000-0000-0000-000000000000 and media_set_id = 36421 and family_sequence_number = 9.778156605E-311) points to the data row identified by ().
Server: Msg 8952, Level 16, State 1, Line 1
Table error: Database 'msdb', index 'backupmediafamily.backupmediafamilyuuid' (ID 2069582411) (index ID 2). Extra or invalid key for the keys:
Server: Msg 8956, Level 16, State 1, Line 1
Index row (1:4197:259) with values (media_family_id = ECD92D25-0000-0000-0000-000000000000 and media_set_id = 36393 and family_sequence_number = 9.778156605E-311) points to the data row identified by ().
Server: Msg 8952, Level 16, State 1, Line 1
Table error: Database 'msdb', index 'backupmediafamily.backupmediafamilyuuid' (ID 2069582411) (index ID 2). Extra or invalid key for the keys:
Server: Msg 8956, Level 16, State 1, Line 1
Index row (1:5194:26) with values (media_family_id = 337B262B-0000-0000-0000-000000000000 and media_set_id = 36423 and family_sequence_number = 9.778156605E-311) points to the data row identified by ().
Server: Msg 8952, Level 16, State 1, Line 1
Table error: Database 'msdb', index 'backupmediafamily.backupmediafamilyuuid' (ID 2069582411) (index ID 2). Extra or invalid key for the keys:
Server: Msg 8956, Level 16, State 1, Line 1
Index row (1:5194:153) with values (media_family_id = 798F202C-0000-0000-0000-000000000000 and media_set_id = 36396 and family_sequence_number = 9.778156605E-311) points to the data row identified by ().
Server: Msg 8952, Level 16, State 1, Line 1
Table error: Database 'msdb', index 'backupmediafamily.backupmediafamilyuuid' (ID 2069582411) (index ID 2). Extra or invalid key for the keys:
Server: Msg 8956, Level 16, State 1, Line 1
Index row (1:5198:17) with values (media_family_id = FDA6B08F-0000-0000-0000-000000000000 and media_set_id = 36424 and family_sequence_number = 9.778156605E-311) points to the data row identified by ().
Server: Msg 8952, Level 16, State 1, Line 1
Table error: Database 'msdb', index 'backupmediafamily.backupmediafamilyuuid' (ID 2069582411) (index ID 2). Extra or invalid key for the keys:
Server: Msg 8956, Level 16, State 1, Line 1
Index row (1:5547:46) with values (media_family_id = 263071E9-0000-0000-0000-000000000000 and media_set_id = 36408 and family_sequence_number = 9.778156605E-311) points to the data row identified by ().
Server: Msg 8952, Level 16, State 1, Line 1
Table error: Database 'msdb', index 'backupmediafamily.backupmediafamilyuuid' (ID 2069582411) (index ID 2). Extra or invalid key for the keys:
Server: Msg 8956, Level 16, State 1, Line 1
Index row (1:5942:173) with values (media_family_id = 64B33C73-0000-0000-0000-000000000000 and media_set_id = 36414 and family_sequence_number = 3.799364817E-321) points to the data row identified by ().
Server: Msg 8952, Level 16, State 1, Line 1
Table error: Database 'msdb', index 'backupmediafamily.backupmediafamilyuuid' (ID 2069582411) (index ID 2). Extra or invalid key for the keys:
Server: Msg 8956, Level 16, State 1, Line 1
Index row (1:6207:50) with values (media_family_id = E86E9ED5-0000-0000-0000-000000000000 and media_set_id = 36398 and family_sequence_number = 3.799364817E-321) points to the data row identified by ().
Server: Msg 8952, Level 16, State 1, Line 1
Table error: Database 'msdb', index 'backupmediafamily.backupmediafamilyuuid' (ID 2069582411) (index ID 2). Extra or invalid key for the keys:
Server: Msg 8956, Level 16, State 1, Line 1
Index row (1:6667:71) with values (media_family_id = B066F284-0000-0000-0000-000000000000 and media_set_id = 36407 and family_sequence_number = 9.778156605E-311) points to the data row identified by ().
Server: Msg 8952, Level 16, State 1, Line 1
Table error: Database 'msdb', index 'backupmediafamily.backupmediafamilyuuid' (ID 2069582411) (index ID 2). Extra or invalid key for the keys:
Server: Msg 8956, Level 16, State 1, Line 1
Index row (1:6671:80) with values (media_family_id = 015B0CB8-0000-0000-0000-000000000000 and media_set_id = 36389 and family_sequence_number = 9.778156605E-311) points to the data row identified by ().
Server: Msg 8952, Level 16, State 1, Line 1
Table error: Database 'msdb', index 'backupmediafamily.backupmediafamilyuuid' (ID 2069582411) (index ID 2). Extra or invalid key for the keys:
Server: Msg 8956, Level 16, State 1, Line 1
Index row (1:7578:97) with values (media_family_id = 79657275-0000-0000-0000-000000000000 and media_set_id = 36394 and family_sequence_number = 5.092789936E-313) points to the data row identified by ().
Server: Msg 8952, Level 16, State 1, Line 1
Table error: Database 'msdb', index 'backupmediafamily.backupmediafamilyuuid' (ID 2069582411) (index ID 2). Extra or invalid key for the keys:
Server: Msg 8956, Level 16, State 1, Line 1
Index row (1:7579:142) with values (media_family_id = 61DFE89F-0000-0000-0000-000000000000 and media_set_id = 36391 and family_sequence_number = 5.092789936E-313) points to the data row identified by ().
Server: Msg 8952, Level 16, State 1, Line 1
Table error: Database 'msdb', index 'backupmediafamily.backupmediafamilyuuid' (ID 2069582411) (index ID 2). Extra or invalid key for the keys:
Server: Msg 8956, Level 16, State 1, Line 1
Index row (1:7738:43) with values (media_family_id = D9722AE3-0000-0000-0000-000000000000 and media_set_id = 36403 and family_sequence_number = 9.778156605E-311) points to the data row identified by ().
Server: Msg 8934, Level 16, State 1, Line 1
Table error: Object ID 2073058421, index ID 1. The high key value on page (1:1630) (level 0) is not less than the low key value in the parent (0:1), slot 0 of the next page (1:1815).
Server: Msg 8978, Level 16, State 1, Line 1
Table error: Object ID 2073058421, index ID 1. Page (1:1681) is missing a reference from previous page (1:1815). Possible chain linkage problem.
Server: Msg 8935, Level 16, State 1, Line 1
Table error: Object ID 2073058421, index ID 1. The previous link (1:2231) on page (1:1815) does not match the previous page (1:1630) that the parent (1:1490), slot 164 expects for this page.
Server: Msg 8936, Level 16, State 1, Line 1
Table error: Object ID 2073058421, index ID 1. B-tree chain linkage mismatch. (1:1630)->next = (1:1815), but (1:1815)->Prev = (1:2231).
Server: Msg 8928, Level 16, State 1, Line 1
Object ID 2117582582, index ID 0: Page (1:7853) could not be processed. See other errors for details.
Server: Msg 8928, Level 16, State 1, Line 1
Object ID 2117582582, index ID 0: Page (1:7854) could not be processed. See other errors for details.
Server: Msg 8935, Level 16, State 1, Line 1
Table error: Object ID 2117582582, index ID 2. The previous link (1:6317) on page (1:1593) does not match the previous page (1:4450) that the parent (1:82), slot 105 expects for this page.
Server: Msg 8977, Level 16, State 1, Line 1
Table error: Object ID 2117582582, index ID 2. Parent node for page (1:6317) was not encountered.
DBCC results for 'sysfilegroups'.
There are 1 rows in 1 pages for object 'sysfilegroups'.
DBCC results for 'sysjobschedules'.
There are 19 rows in 1 pages for object 'sysjobschedules'.
DBCC results for 'RTblIfaceMem'.
There are 1189 rows in 9 pages for object 'RTblIfaceMem'.
DBCC results for 'backupfile'.
There are 37551 rows in 1008 pages for object 'backupfile'.
CHECKDB found 0 allocation errors and 1 consistency errors in table 'backupfile' (object ID 18099105).
DBCC results for 'syscategories'.
There are 19 rows in 1 pages for object 'syscategories'.
DBCC results for 'systargetservers'.
There are 0 rows in 0 pages for object 'systargetservers'.
DBCC results for 'RTblWorkspaceItems'.
There are 0 rows in 0 pages for object 'RTblWorkspaceItems'.
DBCC results for 'restorehistory'.
There are 28 rows in 1 pages for object 'restorehistory'.
DBCC results for 'systargetservergroups'.
There are 0 rows in 0 pages for object 'systargetservergroups'.
DBCC results for 'DTA_input'.
There are 1 rows in 1 pages for object 'DTA_input'.
DBCC results for 'RTblDatabaseVersion'.
There are 1 rows in 1 pages for object 'RTblDatabaseVersion'.
DBCC results for 'systargetservergroupmembers'.
There are 0 rows in 0 pages for object 'systargetservergroupmembers'.
DBCC results for 'sysalerts'.
There are 16 rows in 1 pages for object 'sysalerts'.
DBCC results for 'RTblDTSProps'.
There are 0 rows in 0 pages for object 'RTblDTSProps'.
DBCC results for 'RTblVersionAdminInfo'.
There are 2333 rows in 30 pages for object 'RTblVersionAdminInfo'.
DBCC results for 'restorefile'.
There are 56 rows in 2 pages for object 'restorefile'.
DBCC results for 'sysoperators'.
There are 0 rows in 0 pages for object 'sysoperators'.
DBCC results for 'sysnotifications'.
There are 0 rows in 0 pages for object 'sysnotifications'.
DBCC results for 'RTblParameterDef'.
There are 136 rows in 1 pages for object 'RTblParameterDef'.
DBCC results for 'restorefilegroup'.
There are 28 rows in 1 pages for object 'restorefilegroup'.
DBCC results for 'systaskids'.
There are 0 rows in 0 pages for object 'systaskids'.
DBCC results for 'syscachedcredentials'.
There are 0 rows in 1 pages for object 'syscachedcredentials'.
DBCC results for 'RTblIfaceHier'.
There are 3349 rows in 18 pages for object 'RTblIfaceHier'.
DBCC results for 'logmarkhistory'.
There are 0 rows in 0 pages for object 'logmarkhistory'.
DBCC results for 'DTA_progress'.
There are 3 rows in 1 pages for object 'DTA_progress'.
DBCC results for 'RTblNamedObj'.
There are 2196 rows in 22 pages for object 'RTblNamedObj'.
DBCC results for 'sysdtscategories'.
There are 3 rows in 1 pages for object 'sysdtscategories'.
DBCC results for 'sysdtspackages'.
There are 91 rows in 2 pages for object 'sysdtspackages'.
DBCC results for 'DTA_output'.
There are 1 rows in 1 pages for object 'DTA_output'.
DBCC results for 'DTA_tuninglog'.
There are 117 rows in 2 pages for object 'DTA_tuninglog'.
DBCC results for 'DTA_reports_database'.
There are 1 rows in 1 pages for object 'DTA_reports_database'.
DBCC results for 'DTA_reports_partitionfunction'.
There are 0 rows in 0 pages for object 'DTA_reports_partitionfunction'.
DBCC results for 'MSdistpublishers'.
There are 0 rows in 1 pages for object 'MSdistpublishers'.
DBCC results for 'MSdistributiondbs'.
There are 1 rows in 1 pages for object 'MSdistributiondbs'.
DBCC results for 'RTblTypeInfo'.
There are 0 rows in 0 pages for object 'RTblTypeInfo'.
DBCC results for 'MSdistributor'.
There are 1 rows in 1 pages for object 'MSdistributor'.
DBCC results for 'DTA_reports_partitionscheme'.
There are 0 rows in 0 pages for object 'DTA_reports_partitionscheme'.
DBCC results for 'sysreplicationalerts'.
There are 2 rows in 1 pages for object 'sysreplicationalerts'.
DBCC results for 'MSagent_profiles'.
There are 15 rows in 1 pages for object 'MSagent_profiles'.
DBCC results for 'sysdtspackagelog'.
There are 0 rows in 0 pages for object 'sysdtspackagelog'.
DBCC results for 'MSagent_parameters'.
There are 228 rows in 2 pages for object 'MSagent_parameters'.
DBCC results for 'DTA_reports_table'.
There are 116 rows in 1 pages for object 'DTA_reports_table'.
DBCC results for 'RTblScriptDefs'.
There are 0 rows in 0 pages for object 'RTblScriptDefs'.
DBCC results for 'MSdatatype_mappings'.
There are 185 rows in 2 pages for object 'MSdatatype_mappings'.
DBCC results for 'RTblOLPProps'.
There are 0 rows in 0 pages for object 'RTblOLPProps'.
DBCC results for 'sysdtssteplog'.
There are 0 rows in 0 pages for object 'sysdtssteplog'.
DBCC results for 'RTblEnumerationDef'.
There are 0 rows in 0 pages for object 'RTblEnumerationDef'.
DBCC results for 'DTA_reports_tableview'.
There are 0 rows in 0 pages for object 'DTA_reports_tableview'.
DBCC results for 'sysdtstasklog'.
There are 0 rows in 0 pages for object 'sysdtstasklog'.
DBCC results for 'DTA_reports_query'.
There are 2 rows in 1 pages for object 'DTA_reports_query'.
DBCC results for 'RTblSumInfo'.
There are 0 rows in 0 pages for object 'RTblSumInfo'.
DBCC results for 'RTblMDSProps'.
There are 0 rows in 0 pages for object 'RTblMDSProps'.
DBCC results for 'DTA_reports_querytable'.
There are 4 rows in 1 pages for object 'DTA_reports_querytable'.
DBCC results for 'RTblEnumerationValueDef'.
There are 0 rows in 0 pages for object 'RTblEnumerationValueDef'.
DBCC results for 'DTA_reports_querydatabase'.
There are 2 rows in 1 pages for object 'DTA_reports_querydatabase'.
DBCC results for 'RTblUMLProps'.
There are 0 rows in 0 pages for object 'RTblUMLProps'.
DBCC results for 'DTA_reports_index'.
There are 145 rows in 2 pages for object 'DTA_reports_index'.
DBCC results for 'sysdbmaintplans'.
There are 1 rows in 1 pages for object 'sysdbmaintplans'.
DBCC results for 'DTA_reports_queryindex'.
There are 16 rows in 1 pages for object 'DTA_reports_queryindex'.
DBCC results for 'DTA_reports_column'.
There are 73 rows in 1 pages for object 'DTA_reports_column'.
DBCC results for 'sysdbmaintplan_jobs'.
There are 0 rows in 1 pages for object 'sysdbmaintplan_jobs'.
DBCC results for 'DTA_reports_indexcolumn'.
There are 24 rows in 1 pages for object 'DTA_reports_indexcolumn'.
DBCC results for 'RTblUMXProps'.
There are 0 rows in 0 pages for object 'RTblUMXProps'.
DBCC results for 'sysdbmaintplan_databases'.
There are 0 rows in 1 pages for object 'sysdbmaintplan_databases'.
DBCC results for 'RTblSIMProps'.
There are 0 rows in 0 pages for object 'RTblSIMProps'.
DBCC results for 'sysdbmaintplan_history'.
There are 0 rows in 1 pages for object 'sysdbmaintplan_history'.
CHECKDB found 0 allocation errors and 1 consistency errors in table 'sysdbmaintplan_history' (object ID 1090102924).
DBCC results for 'DTA_reports_querycolumn'.
There are 22 rows in 1 pages for object 'DTA_reports_querycolumn'.
DBCC results for 'RTblGENProps'.
There are 0 rows in 0 pages for object 'RTblGENProps'.
DBCC results for 'RTblDTMProps'.
There are 0 rows in 0 pages for object 'RTblDTMProps'.
DBCC results for 'log_shipping_primaries'.
There are 0 rows in 0 pages for object 'log_shipping_primaries'.
DBCC results for 'log_shipping_secondaries'.
There are 0 rows in 0 pages for object 'log_shipping_secondaries'.
DBCC results for 'RTblDBMProps'.
There are 0 rows in 0 pages for object 'RTblDBMProps'.
DBCC results for 'RTblEQMProps'.
There are 0 rows in 0 pages for object 'RTblEQMProps'.
DBCC results for 'mswebtasks'.
There are 0 rows in 0 pages for object 'mswebtasks'.
DBCC results for 'RTblVersions'.
There are 2333 rows in 27 pages for object 'RTblVersions'.
DBCC results for 'RTblDBXProps'.
There are 0 rows in 0 pages for object 'RTblDBXProps'.
DBCC results for 'RTblRelships'.
There are 6922 rows in 146 pages for object 'RTblRelships'.
DBCC results for 'RTblSites'.
There are 44 rows in 1 pages for object 'RTblSites'.
DBCC results for 'RTblProps'.
There are 393 rows in 3 pages for object 'RTblProps'.
DBCC results for 'RTblRelshipProps'.
There are 28 rows in 1 pages for object 'RTblRelshipProps'.
DBCC results for 'RTblPropDefs'.
There are 797 rows in 10 pages for object 'RTblPropDefs'.
DBCC results for 'RTblRelColDefs'.
There are 320 rows in 4 pages for object 'RTblRelColDefs'.
DBCC results for 'RTblIfaceDefs'.
There are 453 rows in 5 pages for object 'RTblIfaceDefs'.
DBCC results for 'backupmediaset'.
There are 34167 rows in 384 pages for object 'backupmediaset'.
CHECKDB found 0 allocation errors and 8 consistency errors in table 'backupmediaset' (object ID 2037582297).
DBCC results for 'sqlagent_info'.
There are 0 rows in 0 pages for object 'sqlagent_info'.
DBCC results for 'RTblClassDefs'.
There are 537 rows in 5 pages for object 'RTblClassDefs'.
DBCC results for 'sysdownloadlist'.
There are 0 rows in 0 pages for object 'sysdownloadlist'.
DBCC results for 'backupmediafamily'.
There are 34129 rows in 667 pages for object 'backupmediafamily'.
CHECKDB found 0 allocation errors and 35 consistency errors in table 'backupmediafamily' (object ID 2069582411).
DBCC results for 'sysjobhistory'.
There are 895 rows in 197 pages for object 'sysjobhistory'.
CHECKDB found 0 allocation errors and 4 consistency errors in table 'sysjobhistory' (object ID 2073058421).
DBCC results for 'sysjobs'.
There are 20 rows in 1 pages for object 'sysjobs'.
DBCC results for 'RTblTFMProps'.
There are 0 rows in 0 pages for object 'RTblTFMProps'.
DBCC results for 'RTblRelshipDefs'.
There are 144 rows in 1 pages for object 'RTblRelshipDefs'.
DBCC results for 'backupset'.
There are 36070 rows in 1673 pages for object 'backupset'.
CHECKDB found 0 allocation errors and 4 consistency errors in table 'backupset' (object ID 2117582582).
DBCC results for 'sysjobservers'.
There are 20 rows in 1 pages for object 'sysjobservers'.
DBCC results for 'RTblTypeLibs'.
There are 17 rows in 1 pages for object 'RTblTypeLibs'.
DBCC results for 'sysjobsteps'.
There are 28 rows in 9 pages for object 'sysjobsteps'.
DBCC results for 'RTblClassExtension'.
There are 69 rows in 1 pages for object 'RTblClassExtension'.
CHECKDB found 0 allocation errors and 56 consistency errors in database 'msdb'.
repair_allow_data_loss is the minimum repair level for the errors found by DBCC CHECKDB (msdb ).
DBCC execution completed. If DBCC printed error messages, contact your system administrator.
Please let me know the followings, as I never found issues with MSDB database before... I read that this database only keep track of your SQL Server agent jobs so at wrost I will end up loosing all my Maitenance plans? or will I loose something else
1. Should I restore MSDB backup up takes 3 days ago?
2. Or should I repair it with data loss? will it effect any Database entries?
SKR
View 5 Replies
View Related
Dec 6, 2005
We're developing an application request/packaging/rollout worflowapplication for our 50 site, 40,000 user company. There is a requesttable, an engineering table, a distribution table, etc. etc. But, thecompany has a designated "Application Owner" at each site, and eachperson who will use the application must also be listed in the workflowapplication. So, we need a lookup table for the owners and users:CREATE TABLE REQUEST (RQ_ID INTEGER NOT NULL,RQ_BY_ID INTEGER NOT NULL,RQ_FOR_ID INTEGER NOT NULL,ASSIGNED_ENGINEER_ID INTEGER NOT NULL,OTHER INFO...);CREATE TABLE APP_OWNERS (RQ_ID INTEGER NOT NULL,OWNER_ID INTEGER NOT NULL);CREATE TABLE APP_USERS (RQ_ID INTEGER NOT NULL,USER_ID INTEGER NOT NULL);There are many other tables, of course, some with single person IDfields and addititional lookup tables where there are multiple peopleinvolved like testers, package distributors, etc. I began to wonder,why not just a single table to cover ALL the people involved:CREATE TABLE RQ_WORKFLOW_PEOPLE (RQ_ID INTEGER NOT NULL,PERSON_ROLE VARCHAR(20) NOT NULL,PERSON_ID INTEGER NOT NULL);INSERT INTO RQ_WORKFLOW_PEOPLE (rq_id,person_role,person_id) values(123456,'RQ BY',314159),(123456,'RQ FOR',951413),(123456,'APP OWNER',159413),(123456,'APP OWNER',413159),(123456,'USER',594131),(123456,'USER',313459),.....The real question I have is how does one evaluate options like this?The good news, I think, is that where I simply must have crossreference tables because of multiple values (application owners, users,testers, etc.) I've reduced the number of those tables to one byspecifying a single table by role. Is that a good thing or a bad thing?I've also removed similar data from several other tables where only asingle column was needed in those tables, i.e. the requested by andrequested for fields, the assigned engineer, and several others. Thereis one and only one of each for each request but the type of data, thatis an employee ID is exactly the same, so does it make more "sense" tokeep the data with the request table or the engineering table orconsolidate all ID data in an ID table?Any thoughts on this woudl be appreciated.Randy
View 2 Replies
View Related