Welcome! Log In Create A New Profile

Advanced

Composite Keys in OleDB for SQL Server

Posted by Gus 
Gus
Composite Keys in OleDB for SQL Server
April 13, 2009 03:34AM
Hi:
I have a table with a composite Key in SQL Server. I'm using Ole DB dirvers and I can't import/create the composite key for that table. According documentation, composite Keys are not available in OleDB...So, what do I have to do in order to use this table?

Thanks;
Gus
Al
Re: Composite Keys in OleDB for SQL Server
April 13, 2009 07:18AM
Hello Gus

Could you manually create the composite key using a trigger ?

Regards
Al
gus
Re: Composite Keys in OleDB for SQL Server
April 13, 2009 06:27PM
Hi Al:
In fact, SQL is working fine with the composite key in the table. The problem I have is in order to use that table with WinDev, I need to have it defined in the Analysis. But I can't define the composite key in the analysis, so I wonder how I could browse or process the file in the order defined by that composite key....
I saw I can use ODBC driver for that table, and then I will be able to use define the composite key. However, I will not be able to use HFile commands (I would need to use SQL)

Thanks;
Gus
Greg palmer
Re: Composite Keys in OleDB for SQL Server
April 15, 2009 04:08PM
Hi

I imported a lot of tables from sql using oledb and they all have composit keys and everything seems to work fine.

Greg
Gus
Re: Composite Keys in OleDB for SQL Server
April 15, 2009 08:56PM
Hi Greg:
Thanks for the response.
It's weird because each time I tried I got a complain about one key can not be imported. This key is a composite key...Then, I checked documentation up, and I saw composite keys are not available in OleDB driver.

I have a table with two fields:
userID nvarchar(10)
rolesID nvarchar(10)

and one primary key with both fields: userID,rolesID (i.e, a composite key).
When I try to import in the analysis, I get the error and the imported table doesn't have any key at all. Moreover, if you want to add a composite key by hand, the table's fields don't appear in the left side of the windows, so there is no way to create the composite key manually...

Do you have some basic working example to send me? (gus at yahoo dor com )

Thanks;
Gus
Greg Palmer
Re: Composite Keys in OleDB for SQL Server
April 16, 2009 07:49PM
Hi Gus

I don't have an example to send you. But I imported about 20 tables at once and they all imported ok.

When you import them let windev convert them to hyperfile and then when your done change them back to use a oledb connection

Greg
Greg Palmer
Re: Composite Keys in OleDB for SQL Server
April 16, 2009 08:22PM
Hi Gus

Just for fun I tried importing some more tables from sql using oledb simple provider and they all worked ok. All the comosite keys imported correctly.

Have you tried justed importing a single table?

I'm using 12.0 if that matters.

Greg
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: