Badia Posted October 13, 2004 Posted October 13, 2004 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 Quote
kejpa Posted October 13, 2004 Posted October 13, 2004 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 Quote
Badia Posted October 13, 2004 Author Posted October 13, 2004 Dear Kejpa I'm using SQLServer 2000 and vb.net Quote
kejpa Posted October 14, 2004 Posted October 14, 2004 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 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.