Syntax error for user function called with a function as parameter

  • Hallo,

    I've a problem with this portion of the trigger:

    insert into dbo.T_Ap_Terms

    select distinct News_ID, s.K, 5

    from inserted a

    cross apply dbo.usf_Split(dbo.usf_Simplify(a.Titolo),' ') s

    I got this error:

    Syntax error near '.'

    dbo.usf_Split and dbo.usf_Simplify are 2 user defined function that works correctly.

    How can I pass a function as a parameter for another function?

    Thanks

  • Your syntax is correct. The reason that it does not parse correctly is probably because you have the database in compat 80 (SQL Server 2005 with level set back to 2000) instead of compat 90, that is all.

    Please try to run this to check the level:

    select

    [name], database_id, create_date, compatibility_level

    from sys.databases;

    If the level is 80 for your database in question then my guess is correct. If you need to change it to native level 90, you can run

    exec dbo.sp_dbcmptlevel @dbname = N'your_db_name_here', @new_cmptlevel = 90;

    go

    Oleg

  • Yes, after the change of compact from 80 to 90, now the syntax is correct.

    Thanks.

Viewing 3 posts - 1 through 2 (of 2 total)

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