Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi everyone.

I have a table named Transactions which has columns transaction_id, Order_id, ...etc. The goal is to make a primary key as a uniqe combination of Transaction_id and Oreder_id.

Please help

Posted

To you most things are very obvious. To the rest of us they are very obscure.

What database engine?

Through .NET code? (Which language?)

 

Let us know and we'll help.

 

/Kejpa

Posted

If you're the one creating tables the primary key should be created at the same time.

If you have access enough to the database it's very easy to handle these tasks with some UI, SQL Administrator (can't rememer what it's called).

 

In SQL code it's

ALTER TABLE WhatEver ADD CONSTRAINT WhatEver_pk PRIMARY KEY (ColA, ColC, ColB) ON DEFAULT

It can be used with a command object

 

Have a quickie in the online help, search for PRIMARY KEY

 

HTH

/Kejpa

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...