SprocDoc

Paste a stored procedure. Get the business rules.

SprocDoc reads SQL Server procedures, triggers, views and functions and explains what they really do: the rules, the tables they touch, the side effects and the risks. In plain language, in seconds. Your SQL is never stored.

Early users get free documentation credits at launch.

A real trigger, read by SprocDoc

From Microsoft's public AdventureWorks sample database.

Sales.iduSalesOrderDetail.sqlexcerpt
CREATE TRIGGER [Sales].[iduSalesOrderDetail]  ON [Sales].[SalesOrderDetail]AFTER INSERT, DELETE, UPDATE AS  ...BEGIN TRY  IF UPDATE([ProductID]) OR UPDATE([OrderQty])2     OR UPDATE([UnitPrice]) OR ...  BEGIN    INSERT INTO [Production].[TransactionHistory] ...    UPDATE [Person].[Person] ...      ... TotalPurchaseYTD + sql:column("inserted.LineTotal")  END;  UPDATE [Sales].[SalesOrderHeader]  SET [SubTotal] = (SELECT SUM([LineTotal]) ...)  WHERE [SalesOrderID] IN1    (SELECT inserted.[SalesOrderID] FROM inserted);  UPDATE [Person].[Person] ...    ... TotalPurchaseYTD - sql:column("deleted.LineTotal")END TRYBEGIN CATCH  IF @@TRANCOUNT > 0 ROLLBACK TRANSACTION;  EXECUTE [dbo].[uspLogError];3END CATCH;
Documentationgenerated in seconds

Sales.iduSalesOrderDetail

Trigger on order lines

Summary

Every time an order line is added, changed or removed, this trigger keeps the product transaction history, the order subtotal and each customer's year-to-date purchases in sync.

Business rules

  1. New or repriced lines are logged as a sales movement and added to the customer's yearly total.
  2. The order subtotal is recalculated as the sum of its lines.
  3. The old line total is subtracted from the customer's yearly total when a line changes or is removed.

Risks

  • 1
    HighDeleting a line never updates the subtotal.The recalculation filters on inserted, which is empty on DELETE.
  • 2
    HighYearly totals drift down.The old total is subtracted on every update, but added back only when product, quantity or price change.
  • 3
    LowErrors are swallowed.The failure is logged and rolled back, but never re-raised to the caller.

Every object, documented the same way

  • SummaryWhat it does, in one or two sentences a product owner can read.
  • ParametersEach input and output, its type and its role.
  • Business rulesThe conditions and decisions hidden in the code.
  • Tables affectedEvery table read, inserted, updated or deleted.
  • Side effectsProcedures it calls and triggers it sets off.
  • RisksSilent failures, inconsistent data, dynamic SQL, missing transactions.
  • Open questionsWhat the code can't tell, so you know what to confirm with someone.

For whoever inherited the database

The person who wrote that procedure left years ago. The rules live in T-SQL, nobody wants to touch it, and every new developer spends weeks learning what it does.

SprocDoc is for developers and tech leads maintaining SQL Server systems, consultancies taking over a client's codebase, and teams planning a migration who need to know what the old system really does first.

Your SQL stays yours

  • Your code is processed in memory and discarded. It is never written to a database, a file or a log.
  • We only keep your account, your credit balance and a count of how many objects you documented.
  • No third-party tracking on the editor page.
  • If your company's policy requires it, remove names and sensitive values before pasting. The documentation still works.

Get early access

SprocDoc launches soon. Join the waitlist and you'll get free documentation credits on day one.