You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

InsertCategoryLog.sql 355B

12345678910111213141516
  1. CREATE PROCEDURE InsertCategoryLog
  2. @CategoryID INT,
  3. @LogID INT
  4. AS
  5. BEGIN
  6. SET NOCOUNT ON;
  7. DECLARE @CatLogID INT
  8. SELECT @CatLogID FROM CategoryLog WHERE CategoryID=@CategoryID and LogID = @LogID
  9. IF @CatLogID IS NULL
  10. BEGIN
  11. INSERT INTO CategoryLog (CategoryID, LogID) VALUES(@CategoryID, @LogID)
  12. RETURN @@IDENTITY
  13. END
  14. ELSE RETURN @CatLogID
  15. END