SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE [dbo].[p_grid_grpcls_classes_find]
    @group_code ais_code_short = '%',
    @brand_code ais_code_short = '%',
    @class_code ais_code_medium = '%',
    @model varchar(50) = '%',
    @version varchar(50) = '%',
	@vin varchar(50) = '%'
AS 

	select	*
	from	grpcls_classes 
	where	(@group_code = '' or @group_code = '%' or clsc_group_code = @group_code)
	AND		(@brand_code = '' or @brand_code = '%' or clsc_brand_code = @brand_code)
	AND		(@class_code = '' or @class_code = '%' or clsc_class_code = @class_code)
	AND		(@model = '' or @model = '%' or clsc_model = @model)
	AND		(@version = '' or @version = '%' OR clsc_version = @version)
	AND		(@vin = '' or clsc_vin like @vin)







GO
