Check for import error table

T

TGW

Hi,
Is there a simple way of checking if a import error table exists or not?
The background is we have a process where users import files and process the
data to output another file. This is all done through a form where the users
do not have access to the back end. However to keep things simple we have
turned of the warnings so the user may not be aware that import errors have
accounts.
I therefore am thinking of writing some code that will check if the error
table exists or not and inform the user through a message box or is there a
simpler way.
Tks
 
J

Jerry Whittle

The following query will list any such tables:

SELECT MSysObjects.Name, MSysObjects.Type
FROM MSysObjects
WHERE MSysObjects.Name) Like "*ImportErrors"
AND MSysObjects.Type=1
ORDER BY MSysObjects.Name;

The following would count them up. You could do something if the
ImportErrorTables > 0.

SELECT Count(MSysObjects.Type) AS ImportErrorTables
FROM MSysObjects
WHERE MSysObjects.Name) Like "*ImportErrors"
GROUP BY MSysObjects.Type
HAVING MSysObjects.Type=1;
 
T

Tom Wickernards

Correction!

If you used DTS then you wouldn't have to deal with such tedium!


Move to SQL Server, kids
 
T

TGW

Tks, worked a dream

Jerry Whittle said:
The following query will list any such tables:

SELECT MSysObjects.Name, MSysObjects.Type
FROM MSysObjects
WHERE MSysObjects.Name) Like "*ImportErrors"
AND MSysObjects.Type=1
ORDER BY MSysObjects.Name;

The following would count them up. You could do something if the
ImportErrorTables > 0.

SELECT Count(MSysObjects.Type) AS ImportErrorTables
FROM MSysObjects
WHERE MSysObjects.Name) Like "*ImportErrors"
GROUP BY MSysObjects.Type
HAVING MSysObjects.Type=1;
 
J

Jerry Whittle

Hi Aaron Kempf. You sure are back with a vengence today. Got extra time on
your hands after being fired again?
 
N

Neil Gallagher

I have a couple more basic questions: under what conditions is an import errors table created, and what do I need to do to see it? When I run the import I get a message telling me there are errors, and the help facility says that key violations should trigger an errors table, but I am not seeing them.

Many thanks.

EggHeadCafe.com - .NET Developer Portal of Choice
http://www.eggheadcafe.com
 
Top