Results 1 to 5 of 5
  1. #1
    Join Date
    Dec 2002
    Posts
    29

    Unhappy Unanswered: No parameters and arguments were supplied

    The story:

    There is a table with a trigger on it. The trigger calls a stored procedure. The stored procedure has no paramters, and the trigger does not pass any parameters to it.
    STILL, when inserting in the table an error occures: "Procedure .... has no parameters and arguments were supplied."

    Did anybody came across a similar problem?

    PS: Probably it's just a simple minor thing that I am missing, but still, any ideas could help, even if they are the most common ones.

    Boti

  2. #2
    Join Date
    Mar 2003
    Location
    N Delhi
    Posts
    11
    Hi ,
    On my machine the following code is working fine. I tried to reproduce your problem ,but it doesn't.

    Is it correctly understood by me or not?

    CREATE TABLE mytab(field1 integer, field2 char(1))

    CREATE PROCEDURE myproc
    AS
    begin
    SELECT count(*) from mytab
    return 0
    end

    CREATE TRIGGER mytrig
    ON mytab
    FOR INSERT
    AS
    exec myproc

    select * from mytab
    insert mytab values(1,'a')

  3. #3
    Join Date
    Dec 2002
    Posts
    29

    Red face Here is the trigger

    Here is the trigger:

    -- trigger start
    CREATE TRIGGER Trig1 ON dbo.Tabel1
    FOR INSERT, UPDATE, DELETE
    AS
    --return
    -- comment1
    declare @date smalldatetime, @first smalldatetime
    set @date = dbo.func1('param') -- comment
    -- comment
    select *
    into #TmpTable from
    (
    select Date, Code from deleted where (Date=@Date)
    union
    select Date, Code from inserted where (Date=@Date)
    ) codes
    -- comment
    exec StoredProc

    -- trigger end


    Maybe this will help to help me more

  4. #4
    Join Date
    Apr 2003
    Location
    UK
    Posts
    11

    Re: Here is the trigger

    Originally posted by botond.baika
    Here is the trigger:

    -- trigger start
    CREATE TRIGGER Trig1 ON dbo.Tabel1
    FOR INSERT, UPDATE, DELETE
    AS
    --return
    -- comment1
    declare @date smalldatetime, @first smalldatetime
    set @date = dbo.func1('param') -- comment
    -- comment
    select *
    into #TmpTable from
    (
    select Date, Code from deleted where (Date=@Date)
    union
    select Date, Code from inserted where (Date=@Date)
    ) codes
    -- comment
    exec StoredProc

    -- trigger end


    Maybe this will help to help me more
    The one error I can see is the line set @date = dbo.func1('param'), this should be select @date = dbo.func1('param').

    If this does not solve your problem, I would look at the definition of the user defined function func1. If there is still a problem, post the definition of func1 please.

  5. #5
    Join Date
    Dec 2002
    Posts
    29

    Talking

    No, that's correct.
    But in the mean-time the problem got solved. My colleague bumped in to the same problem at one of our clients, and he solved the problem there by taking out the "GO" from the end of the trigger.
    At home, this "procedure" did not solve the problem... probably some different collations may be the cause.

    But for now this is OK. I'm still waiting for people who ran into similar "phenomens", because it's rather weard and should not be like this.


    Best regards,
    Botond

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •