473,320 Members | 1,872 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

PrimaryKey

How to keep combination of two column as primary key in a table ?
Mar 7 '09 #1
1 1900
mwasif
802 Expert 512MB
On an existing table, you can create primary key on two columns
Expand|Select|Wrap|Line Numbers
  1. ALTER TABLE table_name ADD PRIMARY KEY ( column1 , column2 );
Mar 7 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: alan | last post by:
Hi Does primarykey property on the datatable object always need to be set in your code (for use with datarow.find) or should this be set automatically from your database tables primary key coz this...
0
by: Alan | last post by:
H When adding a new row to a datatables .row collection how do populate the primarykey field , ie SupplierId. Is there a way of retrieving the next available value automatically Thank Alan.
0
by: MuZZy | last post by:
Hi, I wonder if anybody could help me here: i'm trying to set a primary key on a table DataTable dt = new DataTable; FillTable(dt); dt.PrimaryKey = myDataColumn; , and in case if the...
4
by: Lars E | last post by:
Hi all How can i set primarykey to a datatable. This datatable is in a dataset i get from a backend system. My datatable contains several fields, and i want to make the fields "c-custno1",...
0
by: Indra Bisen | last post by:
Hi, I want to determine column names of Primary Key Columns of a SQL Server Table. To do this I've found following example in MSDN under PrimaryKey property of DataTable. I've add some lines of...
2
by: prasannas | last post by:
what is the difference between unique constraint and primarykey and identifiers?
2
by: google | last post by:
How can I find a DataRow in a DataSet by it's PrimaryKey value? This would be similar to an SQL statement such as "SELECT * FROM MyTable WHERE MyIndex = 2"... In the following code I've tried to...
2
chathura86
by: chathura86 | last post by:
public void insertData(String sql) { if(conn != null) { SqlCommand cmd = new SqlCommand(); cmd.Connection = conn ; //setting the connection to sql command ...
1
Fary4u
by: Fary4u | last post by:
Hi, I'm attempting to update a record via the recordset.update method, However, the recordset object is defined and accesses the correct record that I want to update, as I can retrieve field...
0
Fary4u
by: Fary4u | last post by:
Hi, I'm attempting to update a record via the recordset.update method, However, the recordset object is defined and accesses the correct record that I want to update, as I can retrieve field...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.