Friday, March 9, 2012

Importing data from MSAccess to SQL2000

Hi,
I am very, very new to SQL, so be patient.
On a W2K3-server runs SQL2000 (Sp3a). I have a database in MSAccess (2003) and want to import
the data with the wizard. All went well and I got the whole database in SQL.
Now I am back in VS.net and want to create a SQLAdapter and when doing that I got the warning:
UPDATE and DELETE statement. Could not determin which columns uniquely identify the rows for
"<Table>".
The structure of "<Table>" in MSAccess was:
Id (auto) as primary key
Field1 (text,50)
Field2 (text,50)
That's all.
The structure of the SQL-table after importing-Wizard:
Id (int, Not Null)
Field1 (nvarchar(50),Null)
Field2 (nvarchar(50),Null)
Why cannot SQL recognise this primary key ?
Regards, Ger.Hey,
Is the ID field set as the primary key (double-click table), when showing columns it should have the yellow key icon.|||Thx BMains for answering so quick.
I doubleclicked in Enterprise Manager (I presumed you mean that) on the table and found this
Key ID Name DataType Size Nulls Default
Id int 4 not checked
test nvarchar 50 checked
test1 nvarchar 50 checked
I think, this is what you mean. My conclusion is: Id is not a primary key in this SQL-table.
Q1: why not, because when importing from MSAccess there was a primary key defined in the Access-table.
Q2: how can I set a primary key to the above file ?
Thanks in advance,
regards, Ger.|||

GerEielts wrote:

Q2: how can I set a primary key to the above file ?.


Found this setting, no need for an answer. It can be set by Enterprise Manager,
<database>, Tables, <wanted table>, rightclick and Design Table. In here set the
primary key to a field.
Hope this helps for others too.
regards, Ger

No comments:

Post a Comment