Answer the question
In order to leave comments, you need to log in
How to run a function and put its result into a variable?
CREATE FUNCTION GetConfigID @CL ID INT
RETURNS INT AS
BEGIN
DECLARE @SConfigIdID INT
SET @SConfigIdID = (SELECT ConC. ID FROM tblContract CN
INNER JOIN tblClient CL ON CN.CLIENT_ID = CL.ID INNER JOIN tblCar CR ON CN.CAR_ID = CR.ID
INNER JOIN tblConfigCar ConC ON CR.CONFIG_MODEL_ID = ConC. ID WHERE Cl.ID = @CL_ID)
RETURN @ConfigldID
END
GO
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question