/****** Object:  StoredProcedure [dbo].[OnlineGetTableBookingSeating]    Script Date: 08/22/2011 13:15:50 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER OFF
GO

CREATE PROCEDURE [dbo].[OnlineGetTableBookingSeating] 
 @APax INT = 0
AS

/*
LJE/20110921: Read MaxPax as TableSize.
LJE/20110803: Created.
*/

select tbs.TotalPax 
 ,tbs.Priority
 ,tbs.TableCount
-- ,crt.Type TableSize
 ,crt.MaxPax TableSize
 ,tbs.PaxAtTable
 ,crt.Type 
 ,crt.ConferenceRoomTypeNumber ResourceId
 --,crt.Text TableDescription
 ,tbs.Description SeatingDescription
from TableBookingSeating tbs (NOLOCK), CONFERENCEROOMTYPES crt (NOLOCK)
where tbs.ConferenceRoomTypeNumber = crt.ConferenceRoomTypeNumber
  and tbs.TotalPax = @APax
  and tbs.Enabled = 1
  order by tbs.Priority,crt.Type

GO
