Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

663 B
Raw Blame
- statement: |-
    CREATE FUNCTION dbo.ufnGetInventoryStock(@ProductID int)
    RETURNS int
    AS
    -- Returns the stock level for the product.
    BEGIN
        DECLARE @ret int;
        SELECT @ret = SUM(p.Quantity)
        FROM Production.ProductInventory p
        WHERE p.ProductID = @ProductID
            AND p.LocationID = '6';
        IF (@ret IS NULL)
            SET @ret = 0;
        RETURN @ret;
    END;
  changeType: 1
  want:
    - status: 2
      code: 1701
      title: SYSTEM_FUNCTION_DISALLOW_CREATE
      content: Creating or altering functions is prohibited
      startposition:
        line: 1
        column: 0
      endposition: null