Re: TRIGGER (AFTER INSERT) and Store Procedure ... insert failed !

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Hugo Kornelis (hugo_at_pe_NO_rFact.in_SPAM_fo)
Date: 09/06/04


Date: Mon, 06 Sep 2004 20:58:44 +0200

On Mon, 6 Sep 2004 16:54:52 +0200, Herve MAILLARD wrote:

>Hi,
>
>Well, I've got the error "ODBC insert failed" (from access front end). If I
>try from Enterprise Manager then I have no error at all.
>I can see that the counter field is not incremented..(stay blank) and when I
>try to refresh the table then my record has been removed.
>
>I agree to post the SP code but it's 2 or 3 pages of T-SQL code.
>I'm trying to remove block by block the code to why wich instruction the
>problem is comming from.
>
>I have no insert into the CR_OF, only some updates.
>
>thanks for your help,
>
>Herve.

Hi Herve,

Try executing the insert that causes problems in Query Analyzer. Both
Enterprise Manager and many front end apps have a tendency to swallow the
real error message and give you something else instead. Or in the case of
EM even no message at all, as you've already experienced.

Also, if you want help finding what's wrong, you'll have to post some code
that can be used to recreate your situation and reproduce the error. To be
precies, you need to post all of the following:

1. Table structure, as DDL (CREATE TABLE statements; irrelevant columns
may be omitted but do include all constraint);
2. Sample data, as INSERT statements (so that we can copy, paste & run
instead of spending half an hour typing);
1/2a. Test your DDL and INSERTS. Create an empty database on your server
and run your code. If you get errors, fix them, test again, then post the
fixed code;
3. Expected output, based on sample data;
4. The code you are currently using;
5. The results you see when you run your code (Do you get an error
message? If so, copy and paste it. Do you get wrong ouput? If so, what do
you get and why is that wrong? etc.)
6. A short and concise description of the business problem you're trying
to solve.

I know that this is a lot of information to post. Most of it is probably
not needed to solve the problem. But you'll never know in advance which
parts will be needed and which parts not; therefor, I do ask you to post
it all.

Some tips and tools to help you in providing the data for a post can be
found here: http://www.aspfaq.com/etiquette.asp?id=5006

Best, Hugo

-- 
(Remove _NO_ and _SPAM_ to get my e-mail address)


Relevant Pages

  • Re: SQL tuning
    ... without DDL or sample data to go on). ... The expression in your WHERE clause all preclude the use of an index: ... ClientId is used in a function; ... For further advice, post at least DDL (create table statments, including ...
    (microsoft.public.sqlserver.programming)
  • Re: Access Crashes with CONTAINS in ServerFilter
    ... DDL in SQL ... > information about HowTo provide DDL and sample data) and ADP files. ... > Microsoft Developer Community Support ...
    (microsoft.public.access.formscoding)
  • Re: Help with Update Query
    ... May I ask why this is ALTER ... As for the Update statement in the stored procedure, ... load the tables with sample data, in addition to all the Transact-SQL ... DDL, INSERTS, and T-SQL here and I'll take a look at it. ...
    (microsoft.public.access.queries)
  • Re: The column prefix does not match with a table name or alias Er
    ... Please provide DDL and sample data. ... If the primary key of table Agent is column Agent then try: ...
    (microsoft.public.sqlserver.programming)
  • Re: UDF and SQL2000 - Why doesnt this work?
    ... Basically This is what I want to do - I have created a query ... as DDL (i.e. CREATE TABLE statements; ... Sample data that illustrates the problem, ... Expected output from the sample data supplied; ...
    (microsoft.public.sqlserver.programming)