i am trying to make the store proceture make an #temp table for me but i dont know how to read from other tables and loop throw records
ALTER PROCEDURE dbo.Date_stodulisti
@HotelID int,
@Gerd int,
@FromDate smalldatetime,
@ToDate smalldatetime
AS
declare @temp int
declare @RetValue int
SELECT @temp = id
FROM Herbergi_Gerd
WHERE hotel=@HotelID
// while (!.EOF) how can i make this possible
SELECT @RetValue=COUNT(*)
FROM herb_Action
WHERE herb_Action.gerd=@Gerd
AND herb_Action.bokunarNr NOT LIKE '%\001%'
AND herb_Action.Agency_Customers=0
AND herb_Action.dags_koma<=@FromDate
AND herb_Action.dags_fara>@ToDate
AND cheack_inn>=1
AND herb_Action.hotel=@HotelID
return @RetValue
END
Best regards Hlynur
ALTER PROCEDURE dbo.Date_stodulisti
@HotelID int,
@Gerd int,
@FromDate smalldatetime,
@ToDate smalldatetime
AS
declare @temp int
declare @RetValue int
SELECT @temp = id
FROM Herbergi_Gerd
WHERE hotel=@HotelID
// while (!.EOF) how can i make this possible
SELECT @RetValue=COUNT(*)
FROM herb_Action
WHERE herb_Action.gerd=@Gerd
AND herb_Action.bokunarNr NOT LIKE '%\001%'
AND herb_Action.Agency_Customers=0
AND herb_Action.dags_koma<=@FromDate
AND herb_Action.dags_fara>@ToDate
AND cheack_inn>=1
AND herb_Action.hotel=@HotelID
return @RetValue
END
Best regards Hlynur