ProjetThe/procedureMaison.sql

83 lines
4.4 KiB
Transact-SQL

/*
EEEEEEEEEEEEEEEEEEEEEEVVVVVVVV VVVVVVVVEEEEEEEEEEEEEEEEEEEEEENNNNNNNN NNNNNNNNTTTTTTTTTTTTTTTTTTTTTTT
E::::::::::::::::::::EV::::::V V::::::VE::::::::::::::::::::EN:::::::N N::::::NT:::::::::::::::::::::T
E::::::::::::::::::::EV::::::V V::::::VE::::::::::::::::::::EN::::::::N N::::::NT:::::::::::::::::::::T
EE::::::EEEEEEEEE::::EV::::::V V::::::VEE::::::EEEEEEEEE::::EN:::::::::N N::::::NT:::::TT:::::::TT:::::T
E:::::E EEEEEE V:::::V V:::::V E:::::E EEEEEEN::::::::::N N::::::NTTTTTT T:::::T TTTTTT
E:::::E V:::::V V:::::V E:::::E N:::::::::::N N::::::N T:::::T
E::::::EEEEEEEEEE V:::::V V:::::V E::::::EEEEEEEEEE N:::::::N::::N N::::::N T:::::T
E:::::::::::::::E V:::::V V:::::V E:::::::::::::::E N::::::N N::::N N::::::N T:::::T
E:::::::::::::::E V:::::V V:::::V E:::::::::::::::E N::::::N N::::N:::::::N T:::::T
E::::::EEEEEEEEEE V:::::V V:::::V E::::::EEEEEEEEEE N::::::N N:::::::::::N T:::::T
E:::::E V:::::V:::::V E:::::E N::::::N N::::::::::N T:::::T
E:::::E EEEEEE V:::::::::V E:::::E EEEEEEN::::::N N:::::::::N T:::::T
EE::::::EEEEEEEE:::::E V:::::::V EE::::::EEEEEEEE:::::EN::::::N N::::::::N TT:::::::TT
E::::::::::::::::::::E V:::::V E::::::::::::::::::::EN::::::N N:::::::N T:::::::::T
E::::::::::::::::::::E V:::V E::::::::::::::::::::EN::::::N N::::::N T:::::::::T
EEEEEEEEEEEEEEEEEEEEEE VVV EEEEEEEEEEEEEEEEEEEEEENNNNNNNN NNNNNNN TTTTTTTTTTT*/
IF OBJECT_ID ( 'SelectEventByDate', 'P' ) IS NOT NULL
DROP PROCEDURE SelectEventByDate;
GO
CREATE PROCEDURE SelectEventByDate
@dateV date
AS
SELECT * FROM [ProjetThe].[dbo].[T_event] Where CAST(E_date AS DATE) = @dateV;
RETURN
GO
IF OBJECT_ID ( 'SelectEventBetweenTwoDateTime', 'P' ) IS NOT NULL
DROP PROCEDURE SelectEventBetweenTwoDateTime;
GO
CREATE PROCEDURE SelectEventBetweenTwoDateTime
@dateStart datetime,
@dateEnd datetime
AS
SELECT * FROM [ProjetThe].[dbo].[T_event] Where E_Date>=@dateStart AND E_Date<@dateEnd;
RETURN
GO
/*
RRRRRRRRRRRRRRRRR EEEEEEEEEEEEEEEEEEEEEEPPPPPPPPPPPPPPPPP AAA
R::::::::::::::::R E::::::::::::::::::::EP::::::::::::::::P A:::A
R::::::RRRRRR:::::R E::::::::::::::::::::EP::::::PPPPPP:::::P A:::::A
RR:::::R R:::::REE::::::EEEEEEEEE::::EPP:::::P P:::::P A:::::::A
R::::R R:::::R E:::::E EEEEEE P::::P P:::::P A:::::::::A
R::::R R:::::R E:::::E P::::P P:::::PA:::::A:::::A
R::::RRRRRR:::::R E::::::EEEEEEEEEE P::::PPPPPP:::::PA:::::A A:::::A
R:::::::::::::RR E:::::::::::::::E P:::::::::::::PPA:::::A A:::::A
R::::RRRRRR:::::R E:::::::::::::::E P::::PPPPPPPPP A:::::A A:::::A
R::::R R:::::R E::::::EEEEEEEEEE P::::P A:::::AAAAAAAAA:::::A
R::::R R:::::R E:::::E P::::P A:::::::::::::::::::::A
R::::R R:::::R E:::::E EEEEEE P::::P A:::::AAAAAAAAAAAAA:::::A
RR:::::R R:::::REE::::::EEEEEEEE:::::EPP::::::PP A:::::A A:::::A
R::::::R R:::::RE::::::::::::::::::::EP::::::::P A:::::A A:::::A
R::::::R R:::::RE::::::::::::::::::::EP::::::::P A:::::A A:::::A
RRRRRRRR RRRRRRREEEEEEEEEEEEEEEEEEEEEEPPPPPPPPPPAAAAAAA AAAAAAA*/
IF OBJECT_ID ( 'SelectRepaByDate', 'P' ) IS NOT NULL
DROP PROCEDURE SelectRepaByDate;
GO
CREATE PROCEDURE SelectRepaByDate
@dateV date
AS
SELECT * FROM [ProjetThe].[dbo].[T_repa] Where CAST(R_Date AS DATE) = @dateV;
RETURN
GO
IF OBJECT_ID ( 'SelectRepaBetweenTwoDateTime', 'P' ) IS NOT NULL
DROP PROCEDURE SelectRepaBetweenTwoDateTime;
GO
CREATE PROCEDURE SelectRepaBetweenTwoDateTime
@dateStart datetime,
@dateEnd datetime
AS
SELECT * FROM [ProjetThe].[dbo].[T_repas] Where R_Date>=@dateStart AND R_Date<@dateEnd;
RETURN
GO
IF OBJECT_ID ( 'ListPlat', 'P' ) IS NOT NULL
DROP PROCEDURE ListPlat;
GO
CREATE PROCEDURE ListPlat
@ID_repa int
AS
SELECT T_plat.ID_plat, T_plat.P_nom, T_plat.P_img, T_plat.ID_typePlat FROM [ProjetThe].[dbo].[T_listPlat] RIGHT JOIN T_plat ON T_listPlat.ID_repa=@ID_repa;
RETURN
GO