syntax error

  • Hi,

    I hope you can help me out of this maze.

    I always get an error msg Incorrect syntax near ')' at the line declare @fnfev table (fund as char(8)) and I can't find what's wrong. Something stupid I guess, as usual, but my eyes don't see it. 😉 It'd be great if someone could help me. Thanks ...

    declare @val_datedatetime

    set nocount on

    declare @i int,

    @fundchar(8),

    @fev_idint,

    @today datetime,

    @msgvarchar(500),

    @nokbit,

    @resint,

    @fnamevarchar(200),

    @cmdvarchar(500),

    @dirvarchar(50)

    declare @fnfevtable (fund as char(8))

    -- -----------------------------------------------------------------

    -- INITIALISATIONS

    --

    select @today = getdate()

    insert into @fnfev select * from fnfev(@val_date)

  • It's really syntax error, as it says.

    Open "Create Table" template in QA and see the correct syntax.

    _____________
    Code for TallyGenerator

  • Thanks Sergiy.

    It was definitely a stupid AS error ... 😉

  • You are creating a table or declaring a table? there is no syntax which you are using. Please use create table syntax.

  • dva2007 (9/18/2008)


    You are creating a table or declaring a table? there is no syntax which you are using. Please use create table syntax.

    Ever heard of "Table variables"?

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • I was declaring a table (@fnfev), not creating a temporary table (like #fnfev).

    For my needs a temporary declared table was the best in terms of performance.

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply