Home All Groups Group Topic Archive Search About

Help with stored procedure syntax please

Author
19 Nov 2007 10:25 PM
CodeMonkey
CREATE PROC New_Populate
AS
INSERT INTO tblSIPLinesSiteInputs (InputID, SiteID, InputValue)
SELECT GetInputs.InputID, 1, IsNull(GetInputs.defaultValue,0)
    FROM
        (SELECT tblAllInputs.InputType, tblAllInputs.InputID,
tblAllInputs.ReleaseID
         FROM tblAllInputs
         WHERE tblAllInputs.InputType='Page1' AND
tblAllInputs.ReleaseID='1') AS qryGetInputs
    LEFT JOIN
        (SELECT tblProfiles.Profile, tblProfiles.InputID,
tblProfiles.DefaultValue
        FROM tblProfiles
        WHERE tblProfiles.Profile='2') AS qryGetProfiles
    ON qryGetInputs.InputID = qryGetProfiles.InputID AS GetInputs
GO

The above SP generates the error Incorrect syntax near keyword AS.

Can anyone help please?
Thanks
Andrew.

AddThis Social Bookmark Button