這是我的存儲過程基於多個輸入返回值。但它不起作用。存儲過程返回基於多個輸入的值
USE [E_clinic]
GO
ALTER PROCEDURE [dbo].[Diseasesp1]
@id1 nchar(10),
@id2 nchar(10),
@id3 nchar(10)
AS
BEGIN
SET NOCOUNT ON;
set @[email protected]+1
set @[email protected]+1
set @[email protected]+1
SELECT [Dname]
From [dbo].[Disease] AS D
Left Join [dbo].[Symptom] AS S ON D.[DiseaseID] = S.[DiseaseID]
Where [SymptomID] = @id1 AND [SymptomID] = @id2 AND [SymptomID] = @id3
END
定義「它不工作」 – DavidG
您正在將整數值添加到nchar變量。 –
你也限制'SymptomID'等於3種不同的東西,所以你永遠不會得到任何結果。 – DavidG