1
存储过程工作但什么都不更新!我认为是关于那些陈述
如果@ ... <> null。存储过程更新问题
感谢帮助
ALTER PROCEDURE [dbo].[sp_UpdateLocation]
@id_Location char(6),
@debut_Location smalldatetime,
@premier_Paiement smalldatetime,
@nombre_Mensualité char(2),
@id_Client char(6),
@no_Termes_location char(6),
@niv char(20)
AS
BEGIN
IF @nombre_Mensualité <> null
BEGIN
DECLARE @valeur_auto smallmoney;
DECLARE @paiment_Mensuel smallmoney;
SET @valeur_auto= (SELECT valeur FROM Véhicules where [email protected])
SET @paiment_Mensuel= (@valeur_auto/@nombre_Mensualité)
Update Location
SET [email protected]_Mensuel,nombre_Mensualité[email protected]_Mensualité
WHERE (@id_Location=id_Location)
END
IF @debut_Location <> null
BEGIN
Update Location
SET [email protected]_Location
WHERE @id_Location=id_Location
END
IF @premier_Paiement <> null
BEGIN
Update Location
SET [email protected]_Paiement
WHERE @id_Location=id_Location
END
IF @id_Client <> null
BEGIN
Update Location
SET [email protected]_Client
WHERE @id_Location=id_Location
END
IF @no_Termes_location <> null
BEGIN
Update Location
SET [email protected]_Termes_location
WHERE @id_Location=id_Location
END
IF @niv <> null
BEGIN
Update Location
SET [email protected]
WHERE @id_Location=id_Location
END
END
select*from Location
代替'<> null',尝试'不是NULL' – PaulStock
谢谢它的工作好! – FrankSharp