Hi, I am trying to declare some internal vars in a Stored Procedure to transport them to asecond Select-Statement. But I get error.ALTER PROCEDURE results ( @Round VARCHAR )AS DECLARE @LackaID INT DECLARE @RoundID INT DECLARE @CircuitID INT SELECT R.round_id, R.round_name, R.round_courtid, R.round_date, R.round_weather, U.player_id, U.player_name, U.player_userid, CI.circuit_name,CI.circuit_id, CI.circuit_number, CI.circuit_difficulty, CI.circuit_pair, CI.circuit_image, C.court_difficulty, C.court_circuits,C.court_price, C.court_description, C.court_image FROM user_round R LEFT OUTER JOIN user_player U ON R.round_id = U.player_round LEFT OUTER JOIN user_court C ON C.court_id = R.round_courtid LEFT OUTER JOIN user_circuit CI ON CI.circuit_courtid = C.court_id WHERE round_id = @Round ORDER BY U.player_name SELECT results_hits FROM user_results WHERE results_userid = @LackaID AND results_round = @RoundID AND results_circuitid = @CircuitID ORDER BY results_circuitid
I am trying to get values for @RoundID, @LackaID and @RoundID. @RoundID should have the value of R.round_id@LackaID should have the value of U.player_userid@CircuitID should have the value of CI.Circuit_idCould anyone help me or just give me some tipps how to solve it!With pleasure Valentin-Bye!