473,320 Members | 1,945 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.

Primary Key Count

I'm trying to export some data from one database and upload it to another and
I want to keep the routine generic. My problems is that a couple of the
tables have two fields in the primary key. How do I determine how many
fields in the key? It seems like Table.PrimaryKey.Length has the information
I put in it, not information from the database...
Sep 11 '07 #1
2 1304
Jay,

You will have to get this information from the database. Of course,
this is database specific. Which database are you using on each end?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Jay" <Ja*@discussions.microsoft.comwrote in message
news:99**********************************@microsof t.com...
I'm trying to export some data from one database and upload it to another
and
I want to keep the routine generic. My problems is that a couple of the
tables have two fields in the primary key. How do I determine how many
fields in the key? It seems like Table.PrimaryKey.Length has the
information
I put in it, not information from the database...

Sep 11 '07 #2
Nicholas,

It's a SQL 2005 database on both ends.

"Nicholas Paldino [.NET/C# MVP]" wrote:
Jay,

You will have to get this information from the database. Of course,
this is database specific. Which database are you using on each end?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Jay" <Ja*@discussions.microsoft.comwrote in message
news:99**********************************@microsof t.com...
I'm trying to export some data from one database and upload it to another
and
I want to keep the routine generic. My problems is that a couple of the
tables have two fields in the primary key. How do I determine how many
fields in the key? It seems like Table.PrimaryKey.Length has the
information
I put in it, not information from the database...


Sep 12 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: js | last post by:
I am trying to create a primary key constraint on a view in the following statement. However, I got an error ORA-00907: missing right parenthesis. If the CONSTRAINT clause is removed, then the...
3
by: Dan Hartshorn | last post by:
Anybody know if there is a system function that can be used from a stored procedure that determines if a given primary key has existing dependencies? I want to make a check for this and if there...
1
by: mogi | last post by:
Hi there, I just tried to apply a set of primary keys to a table and after a very long time (like an hour or more) i got this error message .... Unable to create index 'PK_master_data'. ODBC...
11
by: suma | last post by:
Hello, I want to delete duplicate rows in a table when no primary key is defined. For eg: If we have table1 with data as below, Suma 23 100 Suma 23 100 I want to delete a row from this...
6
by: Andreas | last post by:
Hello list, what about uniqueness of inherited primary keys ? eg you have : create table objects ( id int4, date_created timestamp(0), primary key (id)
14
by: Abhi | last post by:
FYI: This message is for the benefit of MS Access Community. I found that this prblem has been encounterd by many but there is hardly any place where a complete solution is posted. So I thought...
5
by: Thomas F.O'Connell | last post by:
We've got a table that has a definition as follows: CREATE TABLE linking_table ( fk int8 REFERENCES source_table( pk1 ), value int8, PRIMARY KEY( fk1, value ) ); I would've thought that...
9
by: Steven C. | last post by:
Hello: I'm getting an error, "primary key not defined" when trying to use the FIND method on the DataTable Rows collection. I have a typed dataset called 'MortgagesDS' that I created with the...
1
by: lorirobn | last post by:
Hi, I have a report that has a query as its record source. The query picks up records from a table that meet certain criterion. The report then counts how many records there are for each key...
3
by: leah | last post by:
I encountered problem when i tried to create a primary key in an existing table which does not have one yet. There are too many records in it and it's hard to find out which one is 'duplicated'....
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
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
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...
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...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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.