This is my store procedure:
I have 4 dropdownlists with 1st having location,2nd storename,3rd rackname,4th bin name
I need to populate store based on location(ie just 1 condition) Like this i need to populate rackname in 3rd dropdownlist based on 2 condition ie location and store. Similarly bin based on 3 conditions ie location,store,rack. For which i have written stored procedure as below:
But not getting the desired result
USE [WEB-ERMS] GO /****** Object: StoredProcedure [dbo].[Usp_LoadDropDownList] Script Date: 12/30/2011 13:52:55 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER PROCEDURE [dbo].[Usp_LoadDropDownList] @FieldName varchar(MAX), @LocationID varchar(MAX), @StoreID varchar(MAX), @RackID varchar(MAX) AS IF(@FieldName='StoreDetails' AND @LocationID<>'' AND @StoreID IS NULL AND @RackID IS NULL) BEGIN Select StoreID,StoreName from tbl_StoreMaster where LocationID=@LocationID END IF(@FieldName='RackDetails' AND @LocationID<>'' AND @StoreID<>'' AND @RackID IS NULL) BEGIN Select RackID,RackName from tbl_RackMaster where LocationID=@LocationID AND StoreID=@StoreID END IF(@FieldName='BinDetails' AND @LocationID<>'' AND @StoreID<>'' AND @RackID<>'') BEGIN Select BinID,BinName from tbl_BinMaster where LocationID=@LocationID AND StoreID=@StoreID AND RackID=@RackID END