USE [WEB-ERMS]
GO
/****** Object: StoredProcedure [dbo].[Usp_SearchQuery] Script Date: 12/30/2011 11:18:36 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[Usp_SearchQuery]
@FieldName varchar(MAX),
@FieldID varchar(MAX)
AS
IF(@FieldName='Company Name' AND @FieldID<>'')
BEGIN
SELECT * FROM tbl_CompanyMaster WHERE CompanyName LIKE @FieldID+'%'
END
IF(@FieldName='Company Code' AND @FieldID<>'')
BEGIN
SELECT * FROM tbl_CompanyMaster WHERE CompanyCode LIKE @FieldID+'%'
END
IF(@FieldName='Category' AND @FieldID<>'')
BEGIN
SELECT * FROM tbl_CompanyMaster WHERE Category LIKE @FieldID+'%'
END