「選択」を1回だけ使用するように以下のコードを改善するにはどうすればよいですか?
IF EXISTS (SELECT [NUMBER] FROM [TABLE] WHERE [ID_RECORD] = @id_record
BEGIN
DECLARE @tmp_variable
SELECT @tmp_variable = [NUMBER] FROM [TABLE] WHERE [ID_RECORD] = @id_record
SET @other_variable = @tmp_variable
END
ELSE
BEGIN
SET @other_variable = 0
END