Friday, March 23, 2012
Problem with Index Tuning Wizard
Before using the ITW, you should get a load of the queries
you are running. You can capture the events in profiler
and then use that load file for the ITW to use.
hth
DeeJay
>--Original Message--
>When running the Index Tuning Wizard (ITW) on our SQL
Server we got a
>error message : 'Could not complete cursor operation
because the table
>schema changed after the cursor was declared'
>The ITW was used only to advice new indexes. I know that
it creates
>hypothetical indexes in the sysindexes table, but what
are the changes
>in the user-tables ?
>How do you use the ITW without interfering with the real
>schema-definitions ?
>thanks,
>Robbert
>.
>
I know how to use the ITW. The problem is the tuning part. According to
the error-message, the ITW makes changes. What are these changes and why
are they interfering?
Robbert
*** Sent via Developersdex http://www.codecomments.com ***
Don't just participate in USENET...get rewarded for it!
sql
Problem with Index Tuning Wizard
error message : 'Could not complete cursor operation because the table
schema changed after the cursor was declared'
The ITW was used only to advice new indexes. I know that it creates
hypothetical indexes in the sysindexes table, but what are the changes
in the user-tables ?
How do you use the ITW without interfering with the real
schema-definitions ?
thanks,
RobbertHi,
Before using the ITW, you should get a load of the queries
you are running. You can capture the events in profiler
and then use that load file for the ITW to use.
hth
DeeJay
>--Original Message--
>When running the Index Tuning Wizard (ITW) on our SQL
Server we got a
>error message : 'Could not complete cursor operation
because the table
>schema changed after the cursor was declared'
>The ITW was used only to advice new indexes. I know that
it creates
>hypothetical indexes in the sysindexes table, but what
are the changes
>in the user-tables ?
>How do you use the ITW without interfering with the real
>schema-definitions ?
>thanks,
>Robbert
>.
>|||My theory on this is while you were running the ITW
someone in your tream made a change to the structure a
table, which caused it to get an error.
I have run ITW a number of times using our Production
Database, with no problems.
Peter
"We are all worms. But I believe that I am a glow-worm."
Winston Churchill
>--Original Message--
>When running the Index Tuning Wizard (ITW) on our SQL
Server we got a
>error message : 'Could not complete cursor operation
because the table
>schema changed after the cursor was declared'
>The ITW was used only to advice new indexes. I know that
it creates
>hypothetical indexes in the sysindexes table, but what
are the changes
>in the user-tables ?
>How do you use the ITW without interfering with the real
>schema-definitions ?
>thanks,
>Robbert
>.
>
Problem with Index Tuning Wizard
Before using the ITW, you should get a load of the queries
you are running. You can capture the events in profiler
and then use that load file for the ITW to use.
hth
DeeJay
>--Original Message--
>When running the Index Tuning Wizard (ITW) on our SQL
Server we got a
>error message : 'Could not complete cursor operation
because the table
>schema changed after the cursor was declared'
>The ITW was used only to advice new indexes. I know that
it creates
>hypothetical indexes in the sysindexes table, but what
are the changes
>in the user-tables ?
>How do you use the ITW without interfering with the real
>schema-definitions ?
>thanks,
>Robbert
>.
>I know how to use the ITW. The problem is the tuning part. According to
the error-message, the ITW makes changes. What are these changes and why
are they interfering?
Robbert
*** Sent via Developersdex http://www.codecomments.com ***
Don't just participate in USENET...get rewarded for it!
problem with index and duplicates
> Hi
> I'm trying to change structure of table 'TB_KONTAKT' to add a fiew fields
-
> but during that I get the following error message:
> 'TB_KONTAKT' table
> - Unable to create index 'PK__TB_KONTAKT__04AFB25B'.
> ODBC error: [Microsoft][ODBC SQL Server Driver][SQL Server]CRE
ATE UNIQUE
> INDEX terminated because a duplicate key was found for index ID 1. Most
> significant primary key is '1190914'.
> [Microsoft][ODBC SQL Server Driver][SQL Server]Could not creat
e constraint.
> See previous errors.
> [Microsoft][ODBC SQL Server Driver][SQL Server]The statement h
as been
> terminated.
> That index is already build and I'm rather scared of destroying it.
> How can I fix the problem?
> Best Regards
> Darek T.
>
It looks like you're attempting to define a primary key on your table.
Primary keys must be unique, and the field(s) that you're keying on have
some duplicate values.Dariusz Tomon,
Are you using Enterprise Manager to apply this change (add new columns)?
AMB
"Dariusz Tomon" wrote:
> Hi
> I'm trying to change structure of table 'TB_KONTAKT' to add a fiew fields
-
> but during that I get the following error message:
> 'TB_KONTAKT' table
> - Unable to create index 'PK__TB_KONTAKT__04AFB25B'.
> ODBC error: [Microsoft][ODBC SQL Server Driver][SQL Server]CRE
ATE UNIQUE
> INDEX terminated because a duplicate key was found for index ID 1. Most
> significant primary key is '1190914'.
> [Microsoft][ODBC SQL Server Driver][SQL Server]Could not creat
e constraint.
> See previous errors.
> [Microsoft][ODBC SQL Server Driver][SQL Server]The statement h
as been
> terminated.
> That index is already build and I'm rather scared of destroying it.
> How can I fix the problem?
> Best Regards
> Darek T.
>
>|||Hi
I'm trying to change structure of table 'TB_KONTAKT' to add a fiew fields -
but during that I get the following error message:
'TB_KONTAKT' table
- Unable to create index 'PK__TB_KONTAKT__04AFB25B'.
ODBC error: [Microsoft][ODBC SQL Server Driver][SQL Server]CREAT
E UNIQUE
INDEX terminated because a duplicate key was found for index ID 1. Most
significant primary key is '1190914'.
[Microsoft][ODBC SQL Server Driver][SQL Server]Could not create
constraint.
See previous errors.
[Microsoft][ODBC SQL Server Driver][SQL Server]The statement has
been
terminated.
That index is already build and I'm rather scared of destroying it.
How can I fix the problem?
Best Regards
Darek T.|||Dariusz Tomon wrote:
> Hi
> I'm trying to change structure of table 'TB_KONTAKT' to add a fiew fields
-
> but during that I get the following error message:
> 'TB_KONTAKT' table
> - Unable to create index 'PK__TB_KONTAKT__04AFB25B'.
> ODBC error: [Microsoft][ODBC SQL Server Driver][SQL Server]CRE
ATE UNIQUE
> INDEX terminated because a duplicate key was found for index ID 1. Most
> significant primary key is '1190914'.
> [Microsoft][ODBC SQL Server Driver][SQL Server]Could not creat
e constraint.
> See previous errors.
> [Microsoft][ODBC SQL Server Driver][SQL Server]The statement h
as been
> terminated.
> That index is already build and I'm rather scared of destroying it.
> How can I fix the problem?
> Best Regards
> Darek T.
>
It looks like you're attempting to define a primary key on your table.
Primary keys must be unique, and the field(s) that you're keying on have
some duplicate values.|||Dariusz Tomon,
Are you using Enterprise Manager to apply this change (add new columns)?
AMB
"Dariusz Tomon" wrote:
> Hi
> I'm trying to change structure of table 'TB_KONTAKT' to add a fiew fields
-
> but during that I get the following error message:
> 'TB_KONTAKT' table
> - Unable to create index 'PK__TB_KONTAKT__04AFB25B'.
> ODBC error: [Microsoft][ODBC SQL Server Driver][SQL Server]CRE
ATE UNIQUE
> INDEX terminated because a duplicate key was found for index ID 1. Most
> significant primary key is '1190914'.
> [Microsoft][ODBC SQL Server Driver][SQL Server]Could not creat
e constraint.
> See previous errors.
> [Microsoft][ODBC SQL Server Driver][SQL Server]The statement h
as been
> terminated.
> That index is already build and I'm rather scared of destroying it.
> How can I fix the problem?
> Best Regards
> Darek T.
>
>
problem with index and duplicates
I'm trying to change structure of table 'TB_KONTAKT' to add a fiew fields -
but during that I get the following error message:
'TB_KONTAKT' table
- Unable to create index 'PK__TB_KONTAKT__04AFB25B'.
ODBC error: [Microsoft][ODBC SQL Server Driver][SQL Server]CREATE UNIQUE
INDEX terminated because a duplicate key was found for index ID 1. Most
significant primary key is '1190914'.
[Microsoft][ODBC SQL Server Driver][SQL Server]Could not create constraint.
See previous errors.
[Microsoft][ODBC SQL Server Driver][SQL Server]The statement has been
terminated.
That index is already build and I'm rather scared of destroying it.
How can I fix the problem?
Best Regards
Darek T.Dariusz Tomon wrote:
> Hi
> I'm trying to change structure of table 'TB_KONTAKT' to add a fiew fields -
> but during that I get the following error message:
> 'TB_KONTAKT' table
> - Unable to create index 'PK__TB_KONTAKT__04AFB25B'.
> ODBC error: [Microsoft][ODBC SQL Server Driver][SQL Server]CREATE UNIQUE
> INDEX terminated because a duplicate key was found for index ID 1. Most
> significant primary key is '1190914'.
> [Microsoft][ODBC SQL Server Driver][SQL Server]Could not create constraint.
> See previous errors.
> [Microsoft][ODBC SQL Server Driver][SQL Server]The statement has been
> terminated.
> That index is already build and I'm rather scared of destroying it.
> How can I fix the problem?
> Best Regards
> Darek T.
>
It looks like you're attempting to define a primary key on your table.
Primary keys must be unique, and the field(s) that you're keying on have
some duplicate values.|||Dariusz Tomon,
Are you using Enterprise Manager to apply this change (add new columns)?
AMB
"Dariusz Tomon" wrote:
> Hi
> I'm trying to change structure of table 'TB_KONTAKT' to add a fiew fields -
> but during that I get the following error message:
> 'TB_KONTAKT' table
> - Unable to create index 'PK__TB_KONTAKT__04AFB25B'.
> ODBC error: [Microsoft][ODBC SQL Server Driver][SQL Server]CREATE UNIQUE
> INDEX terminated because a duplicate key was found for index ID 1. Most
> significant primary key is '1190914'.
> [Microsoft][ODBC SQL Server Driver][SQL Server]Could not create constraint.
> See previous errors.
> [Microsoft][ODBC SQL Server Driver][SQL Server]The statement has been
> terminated.
> That index is already build and I'm rather scared of destroying it.
> How can I fix the problem?
> Best Regards
> Darek T.
>
>
Tuesday, March 20, 2012
Problem with Full TExt Index
I am having a problem with fulltextindex.
when i do replicate a table the full text index on the table in the
destination server is repopulated. As the Table size is very big, i am
looking for any way to skip the repopulation and update incremental.
Please Help.
Thanks and Regards
Siddhardha
What kind of replication set up it is. Send more details about your
publisher, subscriber and distributor.
It will be helpful if you can also add the DDL for your tables.
-Nitin
"Siddhardha" <s.anne@.abcaz.com> wrote in message
news:uLdlVnpwEHA.2624@.TK2MSFTNGP11.phx.gbl...
> Hello,
> I am having a problem with fulltextindex.
> when i do replicate a table the full text index on the table in the
> destination server is repopulated. As the Table size is very big, i am
> looking for any way to skip the repopulation and update incremental.
> Please Help.
> Thanks and Regards
> Siddhardha
>
>
|||if you are using SQL 2000 you should look at change tracking.
Did you look at this kb article as well?
http://support.microsoft.com/default...b;en-us;240867
"Siddhardha" <s.anne@.abcaz.com> wrote in message
news:uLdlVnpwEHA.2624@.TK2MSFTNGP11.phx.gbl...
> Hello,
>
> I am having a problem with fulltextindex.
> when i do replicate a table the full text index on the table in the
> destination server is repopulated. As the Table size is very big, i am
> looking for any way to skip the repopulation and update incremental.
> Please Help.
> Thanks and Regards
> Siddhardha
>
>
Problem with Full Index Search
When i try to search for the exact word 'Function 1' using the CONTAINS keyword, the query retrieving the following results too...
1. Function 1
2. Function 2
3. Function 3
4. Function 4
Where i want the first answer alone. But it works good with the strings (ex: Broken Wire) where both are strings.
Wont it work with the text which is a combination of a string and a number like 'Function 1'
Kindly guide me!!
Mumbaimacroothis is the query i have used
select distinct dStep2.DFMEA_NO REGNO,dStep2.ID,dStep3.Step2_ID,dStep3.FUNC_DESC DESCRIPTION from
FMEA_DFMEA_STEP2 dStep2, FMEA_DFMEA_STEP3 dStep3 WHERE dStep2.ID=dStep3.Step2_ID
AND CONTAINS(dStep3.FUNC_DESC, '"function 1"')
help to do a search for character + number combination|||Try this:
select distinct dStep2.DFMEA_NO REGNO,dStep2.ID,dStep3.Step2_ID,dStep3.FUNC_DESC DESCRIPTION from
FMEA_DFMEA_STEP2 dStep2, FMEA_DFMEA_STEP3 dStep3 WHERE dStep2.ID=dStep3.Step2_ID
AND dStep3.FUNC_DESC like '%function 1%'
Saturday, February 25, 2012
Problem with dbo.sysindexkeys in SQL 2000
I am experiencing some performance issues with the dbo.sysindexkeys.
I wonder if anyone can help me create an index on it?
Thanx!
SQL script:
set nocount on
set ansi_warnings off
--################################################## ##########################################
--################################################## ##########################################
print
'--------------------------'
print ' Create test database'
print
'--------------------------'
use master
go
if not db_id('test') is null
drop database test
go
create database test
go
use test
go
--################################################## ##########################################
--################################################## ##########################################
print
'--------------------------'
print ' Create 4000 tables in test database'
print
'--------------------------'
declare @.i_iter int
set @.i_iter = 0
while @.i_iter < 4000
begin
if @.i_iter % 100 = 0
print 'Table -> ' + cast(@.i_iter as char(10))
exec ('
create table TABLE_' + @.i_iter + '
( COLUMN_0 int not null,
COLUMN_1 int not null,
COLUMN_2 datetime not null,
COLUMN_3 datetime not null,
COLUMN_4 varchar(100) not null,
COLUMN_5 smallint not null,
COLUMN_6 bit not null,
constraint TABLE_' + @.i_iter + '_PK primary key (COLUMN_0,
COLUMN_1, COLUMN_2)
)
create index TABLE_' + @.i_iter + '_I1 on TABLE_' + @.i_iter + '
(COLUMN_4, COLUMN_5)
')
set @.i_iter = @.i_iter + 1
end
go
--################################################## ##########################################
--################################################## ##########################################
print
'--------------------------'
print ' Dump dbo.sysindexkeys in temp. table and create a clustered
index on it'
print
'--------------------------'
if not object_id('dbo.t_sink') is null
drop table dbo.t_sink
go
select * into dbo.t_sink from dbo.sysindexkeys
alter table dbo.t_sink add constraint t_sink_pk primary key ([id] ,
[indid], [colid])
go
print
'--------------------------'
print ' Create a pivot table with all columns in the indexes and
primary keys using this'
print ' temp table'
print
'--------------------------'
if not object_id('tempdb..#dump') is null
drop table #dump
go
declare @.time datetime
set @.time = getdate()
select sobj.name as table_name,
sind.name as index_name,
max(case sink.keyno when 1 then scol.name end) as c01,
max(case sink.keyno when 2 then scol.name end) as c02,
max(case sink.keyno when 3 then scol.name end) as c03,
max(case sink.keyno when 4 then scol.name end) as c04,
max(case sink.keyno when 5 then scol.name end) as c05,
max(case sink.keyno when 6 then scol.name end) as c06,
max(case sink.keyno when 7 then scol.name end) as c07,
max(case sink.keyno when 8 then scol.name end) as c08,
max(case sink.keyno when 9 then scol.name end) as c09
into #dump
from dbo.sysobjects sobj,
dbo.sysindexes sind,
dbo.t_sink sink,
dbo.syscolumns scol
where sobj.xtype = 'u'
and sind.id = sobj.id
and indexproperty(sind.id, sind.name, 'IsAutoStatistics') = 0
and indexproperty(sind.id, sind.name, 'IsStatistics') = 0
and sink.id = sobj.id
and sink.indid = sind.indid
and scol.id = sobj.id
and scol.colid = sink.colid
group by sobj.name,
sind.name
order by sobj.name,
sind.name
print 'Rows: ' + cast(@.@.rowcount as char(10))
set @.time = getdate() - @.time
print 'Time: ' + convert(char(25), @.time, 114)
go
if not object_id('dbo.t_sink') is null
drop table dbo.t_sink
go
--################################################## ##########################################
--################################################## ##########################################
print
'--------------------------'
print ' Create a pivot table with all columns in the indexes and
primary keys using the'
print ' system tables'
print
'--------------------------'
if not object_id('tempdb..#direct') is null
drop table #direct
go
declare @.time datetime
set @.time = getdate()
select sobj.name as table_name,
sind.name as index_name,
max(case sink.keyno when 1 then scol.name end) as c01,
max(case sink.keyno when 2 then scol.name end) as c02,
max(case sink.keyno when 3 then scol.name end) as c03,
max(case sink.keyno when 4 then scol.name end) as c04,
max(case sink.keyno when 5 then scol.name end) as c05,
max(case sink.keyno when 6 then scol.name end) as c06,
max(case sink.keyno when 7 then scol.name end) as c07,
max(case sink.keyno when 8 then scol.name end) as c08,
max(case sink.keyno when 9 then scol.name end) as c09
into #direct
from dbo.sysobjects sobj,
dbo.sysindexes sind,
dbo.sysindexkeys sink,
dbo.syscolumns scol
where sobj.xtype = 'u'
and sind.id = sobj.id
and indexproperty(sind.id, sind.name, 'IsAutoStatistics') = 0
and indexproperty(sind.id, sind.name, 'IsStatistics') = 0
and sink.id = sobj.id
and sink.indid = sind.indid
and scol.id = sobj.id
and scol.colid = sink.colid
group by sobj.name,
sind.name
order by sobj.name,
sind.name
print 'Rows: ' + cast(@.@.rowcount as char(10))
set @.time = getdate() - @.time
print 'Time: ' + convert(char(25), @.time, 114)
goherman (herman@.hotmail.com) writes:
> I am experiencing some performance issues with the dbo.sysindexkeys.
> I wonder if anyone can help me create an index on it?
I guess you could if you change the configuration parameer "allow updates
to system tables", but I have no idea wether SQL Server would actually
look at the index.
Anyway, this query executes almosts as fast as your query with
the temp table:
select sobj.name as table_name,
sind.name as index_name,
index_col(sobj.name, sind.indid, 1) as c01,
index_col(sobj.name, sind.indid, 2) as c02,
index_col(sobj.name, sind.indid, 3) as c03,
index_col(sobj.name, sind.indid, 4) as c04,
index_col(sobj.name, sind.indid, 5) as c05,
index_col(sobj.name, sind.indid, 6) as c06,
index_col(sobj.name, sind.indid, 7) as c07,
index_col(sobj.name, sind.indid, 8) as c08,
index_col(sobj.name, sind.indid, 9) as c09
--into #direct
from dbo.sysobjects sobj
join dbo.sysindexes sind ON sind.id = sobj.id
where sobj.xtype = 'U'
and indexproperty(sind.id, sind.name, 'IsAutoStatistics') = 0
and indexproperty(sind.id, sind.name, 'IsStatistics') = 0
order by sobj.name, sind.name
--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp