title: Create a function to check if the quantity inserted is greater than the quantity in stock
body: <pre><code>CREATE TABLE [dbo].[OrderDetails](
      [OrderID] [int] NOT NULL,
      [ProductID] [int] NOT NULL,
      [UnitPrice] [int] NOT NULL,
      [Quantity] [tinyint] NULL,
      [Discount] [int] NULL,
      [IsActive] [bit] NULL,
      [IsDeleted] [bit] NULL
  ) ON [PRIMARY]
  </code></pre>
  
  <p>I want to create a function which will check if the quantity inserted is greater then the quantity in stock then prevents user from execution.</p>