Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Composite Primary Key #1

Closed
enriko-riba opened this issue Oct 1, 2012 · 7 comments
Closed

Composite Primary Key #1

enriko-riba opened this issue Oct 1, 2012 · 7 comments

Comments

@enriko-riba
Copy link

How can I define a composite primary key where only one of the PK fields is autoincrement?

@schotime
Copy link
Owner

At the moment you can't. Can you elaborate on the scenario you are trying to enable?

@enriko-riba
Copy link
Author

As always with such stuff: new project, foreign DB which I am not supposed to change...
Table has a composite PK where one of them is Identity and the other is is not. Currently its all or nothing regarding the autoincrement - which is fine, until you stumble upon a table like this.
I solved this particular problem with good old SQL Execute but it kinda defeats the purpose...

@schotime
Copy link
Owner

Ok...I think I understand the issue. I'll have to look into what can be done, because at the moment autoIncrement is just true or false.

@enriko-riba
Copy link
Author

Would it make sense to add autoincrement on the field level instead of the class level? It would behave just like the ResultColumn attribute.

@schotime
Copy link
Owner

It might, however I need to look at the implications of that...not just for Sql Server as well.

@rganz
Copy link

rganz commented Mar 14, 2013

Oh... for me this is a serious issue. I have distributed tables over various locations, and they are merged in a central location, so that an autoincrement is not enough. I need at least an additional location field in the primary key...

@rganz
Copy link

rganz commented Mar 14, 2013

Sorry, I was too fast... As I see, a composite Primary Key is possible, just not with an autoincrement. Unfortunately in another table I need exactly this as well...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants