Insert into xHH_QuickScan
(
ScanID,
EmployeeID,
ProjectID,
Barcode,
Scandate,
Scantime,
ManualEntry,
Category,
Date1,
Date2,
Serial,
Descrid,
Date3,
AssetID,
Date4,
AStatus,
BarcodeNew,
SerialNew,
DescrNew
)
Values
(
/****** check DescID value ******/
if @AssetID = ''
Begin
Set @Descrid = ''
End
Else
Begin
Set @Descrid = @Descrid
END
End
@ScanID,
@EmployeeID,
@ProjectID,
@Barcode,
@Scandate,
@Scantime,
@ManualEntry,
@Category,
@Date1,
@Date2,
@Serial,
@Descrid,
@Date3,
@AssetID,
@Date4,
@AStatus,
@BarcodeNew,
@SerialNew,
@DescrNew
)
这会引发错误。我也尝试过 CASE,但有错误。我需要测试@AssetID 的值并相应地更改@Descrid 的值