G
Guest
I am getting a SQL Server Error: 8629
"The query processor could not produce a query plan from the optimizer
because a query cannot update a text, ntext, or image column and a
clustering key at the same time."
I turned the clustering option off for this key and that worked but have
no idea why I need to, what the repercussions are, or if there is another
way to do this.
I am trying to insert the >> very first << row of the table using .NET
and SQL Server 2000.
Here is the layout of my table.
Any thoughts are much appreciated.
Dave
===========================================
if exists (select * from dbo.sysobjects where id =
object_id(N'[dbo].[Table_1]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Table_1]
GO
CREATE TABLE [dbo].[Table_1] (
[ID] [uniqueidentifier] NOT NULL ,
[Field_1] [uniqueidentifier] NULL ,
[Field_2] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Field_3] [bit] NOT NULL CONSTRAINT [DF_Table_1_Field_3] DEFAULT (0),
[Field_4] [bit] NOT NULL CONSTRAINT [DF_Table_1_Field_4] DEFAULT (0),
[Field_5] [bit] NOT NULL CONSTRAINT [DF_Table_1_Field_5] DEFAULT (0),
[Field_6] [text] COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Field_7] [smallint] NOT NULL ,
[Field_8] [uniqueidentifier] NULL ,
[Field_9] [uniqueidentifier] NULL ,
[Field_10] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
[Field_11] [int] NOT NULL ,
CONSTRAINT [PK_Table_1] PRIMARY KEY CLUSTERED
(
[ID]
) ON [PRIMARY] ,
CONSTRAINT [FK_Table_1IDToTable_1AliasTable_1ID] FOREIGN KEY
(
[Field_1]
) REFERENCES [dbo].[Table_1] (
[ID]
),
CONSTRAINT [FK_Table_2IDToTable_4ID] FOREIGN KEY
(
[Field_8]
) REFERENCES [dbo].[Table_2] (
[ID]
),
CONSTRAINT [FK_Field_7ToTable_1Field_7] FOREIGN KEY
(
[Field_7]
) REFERENCES [dbo].[Table_3] (
[ID]
) ON UPDATE CASCADE
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
CREATE UNIQUE INDEX [UN_Table_1_Field_10_Field_11] ON
[dbo].[Table_1]([Field_10], [Field_11]) ON [PRIMARY]
GO
alter table [dbo].[Table_1] nocheck constraint
[FK_Table_1IDToTable_1AliasTable_1ID]
GO
alter table [dbo].[Table_1] nocheck constraint [FK_Table_2IDToTable_4ID]
GO
"The query processor could not produce a query plan from the optimizer
because a query cannot update a text, ntext, or image column and a
clustering key at the same time."
I turned the clustering option off for this key and that worked but have
no idea why I need to, what the repercussions are, or if there is another
way to do this.
I am trying to insert the >> very first << row of the table using .NET
and SQL Server 2000.
Here is the layout of my table.
Any thoughts are much appreciated.
Dave
===========================================
if exists (select * from dbo.sysobjects where id =
object_id(N'[dbo].[Table_1]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Table_1]
GO
CREATE TABLE [dbo].[Table_1] (
[ID] [uniqueidentifier] NOT NULL ,
[Field_1] [uniqueidentifier] NULL ,
[Field_2] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Field_3] [bit] NOT NULL CONSTRAINT [DF_Table_1_Field_3] DEFAULT (0),
[Field_4] [bit] NOT NULL CONSTRAINT [DF_Table_1_Field_4] DEFAULT (0),
[Field_5] [bit] NOT NULL CONSTRAINT [DF_Table_1_Field_5] DEFAULT (0),
[Field_6] [text] COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Field_7] [smallint] NOT NULL ,
[Field_8] [uniqueidentifier] NULL ,
[Field_9] [uniqueidentifier] NULL ,
[Field_10] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
[Field_11] [int] NOT NULL ,
CONSTRAINT [PK_Table_1] PRIMARY KEY CLUSTERED
(
[ID]
) ON [PRIMARY] ,
CONSTRAINT [FK_Table_1IDToTable_1AliasTable_1ID] FOREIGN KEY
(
[Field_1]
) REFERENCES [dbo].[Table_1] (
[ID]
),
CONSTRAINT [FK_Table_2IDToTable_4ID] FOREIGN KEY
(
[Field_8]
) REFERENCES [dbo].[Table_2] (
[ID]
),
CONSTRAINT [FK_Field_7ToTable_1Field_7] FOREIGN KEY
(
[Field_7]
) REFERENCES [dbo].[Table_3] (
[ID]
) ON UPDATE CASCADE
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
CREATE UNIQUE INDEX [UN_Table_1_Field_10_Field_11] ON
[dbo].[Table_1]([Field_10], [Field_11]) ON [PRIMARY]
GO
alter table [dbo].[Table_1] nocheck constraint
[FK_Table_1IDToTable_1AliasTable_1ID]
GO
alter table [dbo].[Table_1] nocheck constraint [FK_Table_2IDToTable_4ID]
GO