| Author |
Topic |
|
The Enigma
Posting Yak Master
179 Posts |
Posted - 2004-03-18 : 05:36:02
|
| create clustered index AOP_C_Idx on AOP_Master([Date])Running this query gives the errorServer: Msg 169, Level 15, State 2, Line 2A column has been specified more than once in the order by list. Columns in the order by list must be unique.However I do not have any other indexes on the table. What could be the problem ??? |
|
|
rihardh
Constraint Violating Yak Guru
307 Posts |
Posted - 2004-03-18 : 05:42:06
|
| What query? |
 |
|
|
The Enigma
Posting Yak Master
179 Posts |
Posted - 2004-03-18 : 05:54:08
|
| Create Index query |
 |
|
|
Frank Kalis
Constraint Violating Yak Guru
413 Posts |
Posted - 2004-03-18 : 06:13:52
|
| Is this the whole statement or just a snippet?--Frankhttp://www.insidesql.de |
 |
|
|
The Enigma
Posting Yak Master
179 Posts |
Posted - 2004-03-18 : 06:15:29
|
| This is the whole code |
 |
|
|
Frank Kalis
Constraint Violating Yak Guru
413 Posts |
Posted - 2004-03-18 : 06:20:22
|
| Interesting!There seems to be no Line 2 in which the error occured.No more code? No CREATE TABLE statement....?--Frankhttp://www.insidesql.de |
 |
|
|
The Enigma
Posting Yak Master
179 Posts |
Posted - 2004-03-18 : 06:32:19
|
| The table has already been created ... tell me one thing should a clustered index necessarily be unique |
 |
|
|
The Enigma
Posting Yak Master
179 Posts |
Posted - 2004-03-18 : 06:37:12
|
| Maybe this is what brett calls a miracle :D |
 |
|
|
Frank Kalis
Constraint Violating Yak Guru
413 Posts |
Posted - 2004-03-18 : 06:43:20
|
| [code]USE FRANK_PLAYGROUNDGOIF OBJECT_ID('CI_test') IS NOT NULL DROP TABLE CI_testGOCREATE TABLE CI_test (col1 INT, col2 CHAR(20))GOCREATE CLUSTERED INDEX CI_t ON CI_test (col2)GOINSERT INTO CI_test (col1, col2) VALUES(1, 'Hello World')INSERT INTO CI_test (col1, col2) VALUES(1, 'Hello World')SELECT * FROM CI_testcol1 col2 ----------- -------------------- 1 Hello World 1 Hello World (2 row(s) affected)[/code]It must not be UNIQUE unless you create it this way. I would say, it depends...--Frankhttp://www.insidesql.de |
 |
|
|
The Enigma
Posting Yak Master
179 Posts |
Posted - 2004-03-18 : 06:48:18
|
Just run the above code and see the execution plan |
 |
|
|
Frank Kalis
Constraint Violating Yak Guru
413 Posts |
Posted - 2004-03-18 : 07:03:04
|
| Do you mean the Table Scan?--Frankhttp://www.insidesql.de |
 |
|
|
The Enigma
Posting Yak Master
179 Posts |
Posted - 2004-03-18 : 07:05:02
|
| no the Querytext for Query 1 |
 |
|
|
Frank Kalis
Constraint Violating Yak Guru
413 Posts |
Posted - 2004-03-18 : 07:14:14
|
| Äh, yes...so what...?!?--Frankhttp://www.insidesql.de |
 |
|
|
The Enigma
Posting Yak Master
179 Posts |
Posted - 2004-03-18 : 07:15:30
|
| just noted that the statement shown is somewhat unrealistic. |
 |
|
|
Frank Kalis
Constraint Violating Yak Guru
413 Posts |
Posted - 2004-03-18 : 07:18:44
|
| Just to make sure. My Query 1 showsinsert [FRANK_PLAYGROUND].[dbo].[CI_test] select * from [FRANK_PLAYGROUND].[dbo].[CI_test]What's wrong that this is done when creating a clustered index?`--Frankhttp://www.insidesql.de |
 |
|
|
The Enigma
Posting Yak Master
179 Posts |
Posted - 2004-03-18 : 07:20:58
|
| Is this what you expected when you create a clustered index ???I was confused by the statement. |
 |
|
|
Frank Kalis
Constraint Violating Yak Guru
413 Posts |
Posted - 2004-03-18 : 07:31:17
|
| Well, I'm not quite sure on this, but I bet that has something to do with establishing the page chain for the clustered index. --Frankhttp://www.insidesql.de |
 |
|
|
The Enigma
Posting Yak Master
179 Posts |
Posted - 2004-03-18 : 07:48:13
|
| Thats what I was pointing out at .. didnt find any doc that it was done ...still searching .. will let you know in case i find something ... and any more ideas for the problem ... I also tried creating clustered index on another column of the same table and same error was repeated. |
 |
|
|
derrickleggett
Pointy Haired Yak DBA
4184 Posts |
Posted - 2004-03-18 : 08:33:50
|
| Can you create any kind of index on the table?MeanOldDBAderrickleggett@hotmail.comWhen life gives you a lemon, fire the DBA. |
 |
|
|
The Enigma
Posting Yak Master
179 Posts |
Posted - 2004-03-19 : 16:11:45
|
http://support.microsoft.com/default.aspx?scid=kb;en-us;293177IT IS A DOCUMENTED BUGAs I thought |
 |
|
|
|