CREATE PROC [dbo].[Proc_SaveProduct]
  @ProductNo VARCHAR(20),
  @ProductType INT
AS
BEGIN
   INSERT INTO [ProductDetectionDetail](ProductNo, ProductType,DetectTime) 
   VALUES(@ProductNo,@ProductType, GETDATE())
   IF @@ROWCOUNT = 1 AND @@ERROR = 0
     SELECT cast(@@IDENTITY as int)
   ELSE
     SELECT cast(0 as int);

END