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