我有一个这样的存储过程:
alter procedure [dbo].[PDTCarDetails]
@carid nvarchar(100)=null,
@plateSource nvarchar(100)=null,
@platecode nvarchar(100)=null,
@plateNumber nvarchar(100)=null,
@parkingType nvarchar(100)=null,
@amount integer=null,
@driverId nvarchar(100)=null,
@cmpl bit=null,
@self bit=null,
@cmplname nvarchar(100)=null,
@remarks nvarchar(100)=null,
@make nvarchar(100)=null,
@model nvarchar(100)=null,
@color nvarchar(100)=null,
@carlocation nvarchar(100)=null,
@comments nvarchar(100)=null
as
begin
SET NOCOUNT ON;
declare @Psid integer,@pcDid integer,@vtype integer,@cmplid integer,@mkid integer,@mdlid integer,
@clrid integer
select @psid= ps.PSID from PlateSource_tbl ps where ps.PS=@plateSource
select @pcDid= pc.PCdID from PlateCode_tbl pc where pc.PlateCode=@platecode
select @vtype= v.vtid from VType_tbl v where v.Vtype=@parkingType
select @cmplid= c.CmplID from Complimentary_tbl c where c.CompName=@cmplname
select @mkid= m.mkid from Make_tbl m where m.Make=@make
select @mdlid= md.mdlid from Model_tbl md where md.Model=@model
select @clrid= cl.colid from Color_tbl cl where cl.Colname=@color
end
首先,我取每个值,然后我取每个值的特定 id