I have such a table structure:
CREATE TABLE Table1 (
Id1 INT IDENTITY(1,1) NOT NULL PRIMARY KEY,
Value VARCHAR(50)
) ON [PRIMARY]
GO
CREATE TABLE Table2 (
Id2 INT IDENTITY(1,1) NOT NULL PRIMARY KEY,
Value VARCHAR(50)
) ON [FILE_GROUP_2]
GO
CREATE TABLE Table3Link (
Id3 INT IDENTITY(1,1) NOT NULL PRIMARY KEY,
Id1 INT NOT NULL,
Id2 INT NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE Table3Link ADD CONSTRAINT FK_Table3Link_Table1 FOREIGN KEY(Id1)
REFERENCES Table1 (Id1)
ON DELETE CASCADE
GO
ALTER TABLE Table3Link ADD CONSTRAINT FK_Table3Link_Table2 FOREIGN KEY(Id2)
REFERENCES Table2 (Id2)
ON DELETE CASCADE
GO
Filegroup [PRIMARY]
is online.
Filegroup [FILE_GROUP_2]
is offline.
When I run query select * from Table1
, I get following error:
The query processor is unable to produce a plan for the table or view 'Table2' because the table resides in a filegroup which is not online.
How can I ignore this integrity validation without making [FILE_GROUP_2]
online?