MissingSchemaAction

  • Thread starter Thread starter Jim Heavey
  • Start date Start date
J

Jim Heavey

If I set the MissingSchemaAction to "error" then I just need to be sure
that each of the columns in my select statement in my data adapter are
"pre-defined" in the DataTable which I wll be loading with the fill
statement. I need to ensure that all relationships are defined as well.
Dow that about cover it?

Assuming that this is correct, my question are...

1. Relationships means - primary keys and foreign keys?
2. If the table that you are loadin has a foreign key, but that particular
table is not being loaded, I would not load that foreign key relationship.
Is that correct?
3. If I am loading the table with a foreign key, I must load the table
with that key first. Is that correct? (order is important).
4. If the table being loaded has a "int16" column and you define that as
an "int32" will that be a violation of the schema?
5. Are you required to set the maximum lengths of the string fields if the
fields on the table being extracted have specific field sizes?
6. If I have a column described as nvarchar(100) do I set the maximum size
to 100 or 200 - do I describe the datatype as String or something else?

Thanks in advance for your assistance!!!!!!
 
Hi Jim,

Jim Heavey said:
If I set the MissingSchemaAction to "error" then I just need to be sure
that each of the columns in my select statement in my data adapter are
"pre-defined" in the DataTable which I wll be loading with the fill
statement. I need to ensure that all relationships are defined as well.
Dow that about cover it?

Assuming that this is correct, my question are...

1. Relationships means - primary keys and foreign keys?

Just foreign keys (and related unique constraints).
2. If the table that you are loadin has a foreign key, but that particular
table is not being loaded, I would not load that foreign key relationship.
Is that correct?

You should not load it - you'll get constraint error.
3. If I am loading the table with a foreign key, I must load the table
with that key first. Is that correct? (order is important).

Indeed.
However, prior to begin loading, you might disable constraints
(EnforceConstraints = false), do fill and after re-enable constraints.
In this way, the order is irrelevant.
4. If the table being loaded has a "int16" column and you define that as
an "int32" will that be a violation of the schema?
No.

5. Are you required to set the maximum lengths of the string fields if the
fields on the table being extracted have specific field sizes?

No. You'll get an error while updating database if a length is exceeded if
you don't set it in datatable.
6. If I have a column described as nvarchar(100) do I set the maximum size
to 100 or 200

100

- do I describe the datatype as String or something else?

string.
 
Back
Top