I want to crate a composite primary key on my table....

I want to crate a composite primary key on my table....

My only concern is that one of the columns in the composite is DATETIME.

Is this going to have a negative effect?

I am using SQL 2005/8
Mr_ShawAsked:
Who is Participating?
 
Aaron ShiloConnect With a Mentor Chief Database ArchitectCommented:
well it wouldent be very "NICE" but you sould have no problem using datetime as a part of your PK
its no different then using any other datatype.
0
 
Aaron ShiloChief Database ArchitectCommented:
no it wont.
but are you sure that you wont have PK vaulations ?
are you going to use this PK for filters in queries ? :

select* from my table
where col1 = 'abc'
and col2 = '2011-05-05 12:32 PM'

0
 
Mr_ShawAuthor Commented:
Yes the primary key will be used in the WHERE cluase.
0
 
Mr_ShawAuthor Commented:
THANKS
0
All Courses

From novice to tech pro — start learning today.