|
Home > Archive > MS SQL Server > March 2005 > Internal Query Processor Error: The query processor could not prod
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Internal Query Processor Error: The query processor could not prod
|
|
| Shri.DBA 2005-03-30, 9:40 am |
| Hello All,
I am getting the below error message when I am trying to read trace file
using fn_trace_gettable function into a table. It will be great if some body
can help to fix this problem Permanently
Error Message
==========
Internal Query Processor Error: The query processor could not produce a
query plan. Contact your primary support provider for more information.
Query
====
insert into dbo.tblWorkCPUTrace
( [DatabaseName], -- [varchar] (128) NOT NULL ,
[DateCollected], -- [datetime] NOT NULL ,
[StartDateTime], -- [datetime] NOT NULL ,
[EndDateTime], -- [datetime] NOT NULL ,
[CPUUsed], -- [numeric] (30,0) NOT NULL
[Reads], -- [numeric] (30,0) NOT NULL
[Writes], -- [numeric] (30,0) NOT NULL
[DatabaseID], -- [int] NOT NULL,
[SPID], -- [int] NULL,
[LoginTime], -- [datetime] NOT NULL ,
[LogoutTime] -- [datetime] NOT NULL
)
select rtrim(isnull(db_nam
e(DatabaseID),conver
t(varchar(10),Databa
seID))),
@ParmDate, -- DateCollected
@FileCreateDate, -- time the trace was started.
@FileLastChangeDate,
-- time the trace was closed.
CPU,
Reads,
Writes,
DatabaseID,
SPID,
StartTime, -- LoginTime
EndTime -- LogoutTime
from ::fn_trace_gettable(
@FullFileName, default)
where CPU > 0
| |
| Jasper Smith 2005-03-30, 9:40 am |
| Does dbo.tblWorkCPUTrace have an index on it ? There is a bug in
fn_trace_gettable where the optimizer produces an unusable plan if the table
you are inserting into has an index on it and some data in it. Either drop
the index before loading or load the results into a temp table and then
insert into the final table. This is fixed in SQL 2005.
--
HTH
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"Shri.DBA" <ShriDBA@discussions.microsoft.com> wrote in message
news:44B46C45-6736-48FF-A1A8- D63C3750C359@microso
ft.com...
> Hello All,
>
> I am getting the below error message when I am trying to read trace file
> using fn_trace_gettable function into a table. It will be great if some
> body
> can help to fix this problem Permanently
>
> Error Message
> ==========
> Internal Query Processor Error: The query processor could not produce a
> query plan. Contact your primary support provider for more information.
>
> Query
> ====
> insert into dbo.tblWorkCPUTrace
> ( [DatabaseName], -- [varchar] (128) NOT NULL ,
> [DateCollected], -- [datetime] NOT NULL ,
> [StartDateTime], -- [datetime] NOT NULL ,
> [EndDateTime], -- [datetime] NOT NULL ,
> [CPUUsed], -- [numeric] (30,0) NOT NULL
> [Reads], -- [numeric] (30,0) NOT NULL
> [Writes], -- [numeric] (30,0) NOT NULL
> [DatabaseID], -- [int] NOT NULL,
> [SPID], -- [int] NULL,
> [LoginTime], -- [datetime] NOT NULL ,
> [LogoutTime] -- [datetime] NOT NULL
>
> )
> select rtrim(isnull(db_name
(DatabaseID),convert
(varchar(10),Databas
eID))),
> @ParmDate, -- DateCollected
> @FileCreateDate, -- time the trace was started.
> @FileLastChangeDate,
-- time the trace was closed.
> CPU,
> Reads,
> Writes,
> DatabaseID,
> SPID,
> StartTime, -- LoginTime
> EndTime -- LogoutTime
> from ::fn_trace_gettable(
@FullFileName, default)
> where CPU > 0
>
>
>
|
|
|
|
|