Forum de discussion
Forum « Programmation ASP » (archives)
Requetes SQL
Envoyé: 20 octobre 2003, 3h06 par samlon
Je dois, pour un site en ASP sur la page d'accueil, recupérer des infos d'une base sql. Mon mandant m'a envoyé les requetes sql correspondantes mais je n'arrive pas a en tirer qqch. voila les procedures en question:
alter table F_Event add EventInputComplete int
go
update F_Event
set EventInputComplete = 1
where eventID in (9451, 9468)
go
create proc qLatestResults
@n int = 5,
@LangID char(2) = 'EN'
as
set rowcount @n
select distinct
EventEffectiveEndDate,
a.CpsID,
a.CpsSeasonYear,
a.ClassID,
CpsSeasonName = isNull(e.LsString,CpsSeasonName),
ClassName = isNull(f.LsString,ClassName)
from F_ROUND a
join F_EVENT b on b.EventID = a.EventID
join F_ChampionshipSeason c on c.CpsID = b.CpsID and c.CpsSeasonYear = a.CpsSeasonYear
join F_Class d on d.CpsID = b.CpsID and d.ClassID = a.ClassID and d.CpsSeasonYear = a.CpsSeasonYear
left join
F_LocalString e on convert(varchar(255),a.CpsID) + convert(varchar(255),a.CpsSeasonYear) = e.LsRecKey and e.LsTableName = 'F_ChampionshipSeason' and e.LsField = 'CpsSeasonName' and e.LangID = @LangID
left join
F_LocalString f on convert(varchar(255),a.CpsID) + convert(varchar(255),a.ClassID) = f.LsRecKey and f.LsTableName = 'F_Class' and f.LsField = 'ClassName' and f.LangID = @LangID
where EventInputComplete = 1
order by
EventEffectiveEndDate, a.CpsID desc
set rowcount 0
go
create procedure qLatestCPs
@n int = 5,
@LangID char(2) = 'EN'
as
set rowcount @n
select a.SubjectID,
Date = convert(varchar(20),a.SubOccDate, 3),
a.PubtypeID,
SubOccComment = IsNull(c.LsString, a.SubOccComment),
a.SubOccRef
from F_SubjectOccurence a
join F_Subject b ON a.SubjectID = b.SubjectID
left join
F_LocalString c on a.SubjectID+convert(varchar(20),a.SubOccDate ,1) + ' ' + convert(varchar(20),a.SubOccDate ,8) = c.LsRecKey and c.LsTableName = 'F_SubjectOccurence' and c.LsField = 'SubOccComment' and c.LangID = @LangID
where a.PubtypeID = 'CP'
Order by a.SubOccDate desc
set rowcount 0
go
comment afficher qqch a partir de ca ?
en sachant que la connexion à la base est établie.
Réponses
|