SQL Server Performance

in-line table function

Discussion in 'SQL Server 2005 Analysis Services' started by bbrian, Jan 15, 2007.

  1. bbrian New Member


    Hi I'm new here. I need to go through all my stored procedures and exclude certain records from all tables that reference the salesid.

    I created an inline table function to do this:

    set ANSI_NULLS ON
    set QUOTED_IDENTIFIER ON
    GO
    ALTER FUNCTION [dbo].[ExcludeFab]
    (@Salesid varchar(25))
    RETURNS TABLE
    AS
    RETURN SELECT *
    from SalesTable
    where SalesTable.salespoolid != 'fab'
    and salesid = @salesid

    This works fine if I pass the salesid as a string (ie '1111') but I cannot pass the salesid itself to this function. If I attempt this I get:

    Msg 155, Level 15, State 1, Line 2
    'salesid' is not a recognized OPTIMIZER LOCK HINTS option.

    Can anyone help?


    Thanks in advance

    bbrian





  2. khtan New Member

  3. FrankKalis Moderator

Share This Page