Home > Archive > microsoft.public.sqlserver.server > November 2002 > no clustered primary key possbile





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 no clustered primary key possbile
Mike Schwarz

2002-11-20, 3:23 pm

hi

im trying to make a clustered index key in sql server enterprise 2000
like in access

- mark colums
- select the key symbol at the top
- alle 3 fields build the new primary key

in sql server, im choosing
- table
- edit
- button for indexes

then i select my 3 fields which should build the new clustered primary key
calldate, destinationNumber, customerNumber

i choose UNIQUE and INDEX, ignore double values in index
and CLUSTERED

as soon as i would like to save the table, i have error message

[Microsoft][ODBC SQL Server Driver][SQL Server]Create unique index aborted
on duplicate key. Primary key is 'Seo 1 2002 12:45AM'
[Microsoft][ODBC SQL Server Driver][SQL Server]Unable to create constraint.
See previous errors.

im sure that there is no dublicate primary key, i checked it in access

why cant i create a clustered primary key with calldate? its a simple
smalldatetime
field. only this 3 fields can build the unique key....
changing the options in indexes did not help much

thank you for any help!

mike


Roy Harvey

2002-11-20, 3:23 pm

Mike,

Try running a query like the following and you will get back the
problem key values:

SELECT calldate, destinationNumber, customerNumber
FROM whateverthenameofthetableis
GROUP BY calldate, destinationNumber, customerNumber
HAVING count(*) > 1

Roy

"Mike Schwarz" <ctek@ctek.ch> wrote:

>hi
>
>im trying to make a clustered index key in sql server enterprise 2000
>like in access
>
>- mark colums
>- select the key symbol at the top
>- alle 3 fields build the new primary key
>
>in sql server, im choosing
>- table
>- edit
>- button for indexes
>
>then i select my 3 fields which should build the new clustered primary key
>calldate, destinationNumber, customerNumber
>
>i choose UNIQUE and INDEX, ignore double values in index
>and CLUSTERED
>
>as soon as i would like to save the table, i have error message
>
>[Microsoft][ODBC SQL Server Driver][SQL Server]Create unique index aborted
>on duplicate key. Primary key is 'Seo 1 2002 12:45AM'
>[Microsoft][ODBC SQL Server Driver][SQL Server]Unable to create constraint.
>See previous errors.
>
>im sure that there is no dublicate primary key, i checked it in access
>
>why cant i create a clustered primary key with calldate? its a simple
>smalldatetime
>field. only this 3 fields can build the unique key....
>changing the options in indexes did not help much
>
>thank you for any help!
>
>mike
>


mike schwarz

2002-11-20, 4:23 pm


i have executed the sql query
its giving me back lots of records with same date... but time is
different!

it seems, that the time is totally ignored in this query, as well in
primary index. sql is just making query against date, not time as
well.... how could this be solved?
making new field with just time in it, so primary key consists of
calldate, calltime, destinationNumber and customerNumber ?

thank you for your help!

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Sponsored Links





Free Braindumps | MCSE braindumps software forum

Copyright 2003 - 2008 examnotes.net