DeZign forDatabasedv6を使用してSQLデータベースを設計しています。
この現在のビューSQLコードまでは、完全に機能していました。
CREATE VIEW %viewname%
AS
SELECT dbo.tblSiteChallengeMember.id, tblSiteMemberDetail_2.memberNickname AS mediator, dbo.tblSiteGame.name AS gameName,
tblSiteMemberDetail_1.memberNickname AS teamMemberName, dbo.tblSiteChallengeMemberTeam.accepted, dbo.tblSiteChallengeMemberTeam.teamNumber,
dbo.tblSiteChallengeMember.matchDate, dbo.tblSiteChallengeMember.dateAdded, dbo.tblSiteChallengeMember.completed,
dbo.tblSiteMemberDetail.memberNickname AS creatorName, dbo.tblSiteChallengeMediator.refferalCount,
dbo.tblSiteChallengeMediator.dateAdded AS mediatorJoinDate
FROM dbo.tblSiteChallengeMemberWin RIGHT OUTER JOIN
dbo.tblSiteChallengeMember INNER JOIN
dbo.tblSiteMemberDetail ON dbo.tblSiteChallengeMember.creatorId = dbo.tblSiteMemberDetail.id ON
dbo.tblSiteChallengeMemberWin.challengeId = dbo.tblSiteChallengeMember.id LEFT OUTER JOIN
dbo.tblSiteMemberDetail AS tblSiteMemberDetail_1 INNER JOIN
dbo.tblSiteChallengeMemberTeam ON tblSiteMemberDetail_1.id = dbo.tblSiteChallengeMemberTeam.memberId ON
dbo.tblSiteChallengeMember.id = dbo.tblSiteChallengeMemberTeam.challengeId RIGHT OUTER JOIN
dbo.tblSiteGame ON dbo.tblSiteChallengeMember.gameId = dbo.tblSiteGame.id LEFT OUTER JOIN
dbo.tblSiteMemberDetail AS tblSiteMemberDetail_2 INNER JOIN
dbo.tblSiteChallengeMediator ON tblSiteMemberDetail_2.id = dbo.tblSiteChallengeMediator.memberId ONCREATE VIEW %viewname%
AS
SELECT dbo.tblSiteChallengeMember.id, tblSiteMemberDetail_2.memberNickname AS mediator, dbo.tblSiteGame.name AS gameName,
tblSiteMemberDetail_1.memberNickname AS teamMemberName, dbo.tblSiteChallengeMemberTeam.accepted, dbo.tblSiteChallengeMemberTeam.teamNumber,
dbo.tblSiteChallengeMember.matchDate, dbo.tblSiteChallengeMember.dateAdded, dbo.tblSiteChallengeMember.completed,
dbo.tblSiteMemberDetail.memberNickname AS creatorName, dbo.tblSiteChallengeMediator.refferalCount,
dbo.tblSiteChallengeMediator.dateAdded AS mediatorJoinDate
FROM dbo.tblSiteChallengeMemberWin RIGHT OUTER JOIN
dbo.tblSiteChallengeMember INNER JOIN
dbo.tblSiteMemberDetail ON dbo.tblSiteChallengeMember.creatorId = dbo.tblSiteMemberDetail.id ON
dbo.tblSiteChallengeMemberWin.challengeId = dbo.tblSiteChallengeMember.id LEFT OUTER JOIN
dbo.tblSiteMemberDetail AS tblSiteMemberDetail_1 INNER JOIN
dbo.tblSiteChallengeMemberTeam ON tblSiteMemberDetail_1.id = dbo.tblSiteChallengeMemberTeam.memberId ON
dbo.tblSiteChallengeMember.id = dbo.tblSiteChallengeMemberTeam.challengeId RIGHT OUTER JOIN
dbo.tblSiteGame ON dbo.tblSiteChallengeMember.gameId = dbo.tblSiteGame.id LEFT OUTER JOIN
dbo.tblSiteMemberDetail AS tblSiteMemberDetail_2 INNER JOIN
dbo.tblSiteChallengeMediator ON tblSiteMemberDetail_2.id = dbo.tblSiteChallengeMediator.memberId ON
dbo.tblSiteChallengeMember.mediatorId = dbo.tblSiteChallengeMediator.id
これはSQLエラーをスローします:
Msg 102, Level 15, State 1, Procedure vwGetChallengeDetails, Line 19
Incorrect syntax near 'ONCREATE'.
私はまだデータベースにかなり慣れていませんが、ONCREATEコマンド(コードのASの上)を見たことがありません。誰かがこれをチェックして、何が問題なのか教えてもらえますか?