I have 2 question that I’d really appreciate some help with in relation to the SP below.1 - Is this structure OK or can it be improved in terms or performance or elegance2 - I’d like to use 2 variables to enable the selection of different tables in the From clause eg FROM @Tablevariable and alsodifferent Fields in the Where clause eg @Fieldvariable >= @StartDateIs this possible?Many thanks in advance CREATE Proc [dbo].[spUnionBikes] ( @StartDate AS DATE = '2000-01-01' ,@EndDate AS DATE )ASBEGIN SELECT ReferralID ,Bike1 AS 'BIKES' ,DateReceived ,DateClosed ,Rider FROM TblReferral WHERE Bike1 IS NOT NULL AND DateReceived >= @StartDate AND DateReceived <= @EndDate UNION ALL SELECT ReferralID ,Bike2 ,DateReceived ,DateClosed ,Rider FROM TblReferral WHERE Bike2 IS NOT NULL AND DateReceived >= @StartDate AND DateReceived <= @EndDate UNION ALL SELECT ReferralID ,Bike3 ,DateReceived ,DateClosed ,Rider FROM TblReferral WHERE Bike3 IS NOT NULL AND DateReceived >= @StartDate AND DateReceived <= @EndDate UNION ALL SELECT ReferralID ,Bike4 ,DateReceived ,DateClosed ,Rider FROM TblReferral WHERE Bike4 IS NOT NULL AND DateReceived >= @StartDate AND DateReceived <= @EndDate ORDER BY BIKES ASCENDGO