SODA+ AI - SQL Object Dependency Analyzer

Step-by-Step User Guide


πŸ“‘ Table of Contents

πŸ“š Getting Started

πŸ”§ Basic Setup

⚑ Core Features

πŸ€– AI & Advanced Analysis

🎯 Workspace & Navigation

πŸ“– Reference


Step 0: Initial Login & Registration (NEW! 🎯)

When you first launch SODA+ AI AI, you'll be prompted to login or register to access AI-powered features.

Why Login?

Registration Process:

  1. Login Dialog Appears on first launch
  2. Switch to the Register tab
  3. Fill in Registration Form:
    • Email: Your email address (used as login ID)
    • Display Name: Your full name or nickname
    • Company: (Optional) Your organization name
  4. Click πŸ“ Register
  5. System Actions:
    • Creates your user account
    • Assigns you a Grok API key from the pool
    • Sets default environment to SANDBOX
    • Configures AI analysis settings
  6. Success Message Shows:
    βœ… Registration successful!
    Welcome, [Your Name]!
    
    ⚠️ Please switch to the Login tab and login to complete the process.
    
  7. Switch to Login tab (email pre-filled for convenience)
  8. Click πŸ”‘ Login to complete

Login Process:

  1. Enter your email in the Login tab
  2. Click πŸ”‘ Login
  3. System Validates:
    • User exists and is active
    • API key is valid and active
    • Session token is generated
  4. Success Message Shows:
    βœ… Welcome back, [Your Name]!
    API Key: xai-57C...XQzUZ (masked)
    Session: tok-9f8...2a1b (masked)
    Usage: 5/100 this month
    
    πŸ”’ Secure session established!
    
  5. Session Saved Locally:
    • Encrypted file stored in %APPDATA%\SODA_PLUS\user_session.dat
    • Uses Windows DPAPI (Data Protection API)
    • Only readable by your Windows user account
    • Auto-login on next application launch

Session Features:

Auto-Login:

Logout:

Security:

Troubleshooting Login:

Issue: "User not found"

Issue: "Account disabled"

Issue: "No API keys available"

Issue: "Session cache incomplete" warning

Issue: Session file corrupted


Getting Started

Step 1: Launch the Application

  1. Run SODA_PLUS_MAIN.exe
  2. If first launch: Login/Registration dialog appears (see Step 0)
  3. If returning user: Auto-login from saved session
  4. The application will then prompt you to select an environment

Step 2: Environment Selection

  1. Environment Selection Dialog will appear with options:
    • SANDBOX (Green - Safe for testing)
    • TEST (Orange - Development environment)
    • PROD (Red - Production with warning)
  2. Select your target environment
  3. Click Apply to continue
  4. ⚠️ Production Warning: If you select PROD, you'll get a safety confirmation dialog

Environment Selection Dialog
Figure 1: Choose your environment - SANDBOX (green), TEST (orange), or PROD (red)


Main Interface Overview

SODA+ Main Interface
Figure 2: Main application window showing Server/Database/Object Explorer (left), Analysis area (center), and Messages (bottom)

The main window has 4 key areas:


Step 3: Connect to Servers (ENHANCED! 🎯)

SODA+ AI now features enhanced server management with support for both Windows and SQL Server authentication, encrypted credential storage, and per-environment server configurations.

New Server Configuration Features:

Adding Your First Server - Enhanced Dialog

  1. In the Server Explorer (top-left), you'll see "No servers configured"
  2. Right-click in the Server Explorer area
  3. Select "Add Server..." from context menu
  4. Enhanced Add Server Dialog Opens:

Dialog Features:

Server Name Section:

Authentication Section:

Option 1: Windows Authentication (Default)

Option 2: SQL Server Authentication

Connection Options:

Security Information Box:

πŸ”’ Security Information:
β€’ SQL Server passwords are encrypted using Windows DPAPI
β€’ Credentials are stored per-user and cannot be decrypted by others
β€’ Windows Authentication is recommended when possible

Action Buttons:

  1. Fill in Server Details:

    Server name: myserver\SQLEXPRESS
    Display Name: Development Server
    
    Authentication: Windows Authentication (selected)
    
    Connection Options:
    βœ“ Trust server certificate
    Connection timeout: 30 seconds
    
  2. Click πŸ”Œ Test Connection to verify

    • Success: Shows server name, version, edition
    • Failure: Shows detailed error with troubleshooting tips
  3. Click Connect to save

    • Server added to current environment (TEST/SANDBOX/PROD)
    • Server list refreshes automatically
    • Server shows in tree with authentication type indicator

Server List Display:

Each server in the tree shows:

ServerName (Auth Type)
  Example: myserver\SQLEXPRESS (Windows Auth)
  Example: prodserver.company.com (sa)

SQL Server Authentication Example:

Server name: sqlserver.company.com
Display Name: Production SQL Server

Authentication: ● SQL Server Authentication
  Login: sa
  Password: β€’β€’β€’β€’β€’β€’β€’β€’
  βœ“ Remember password (encrypted)

Connection Options:
  βœ“ Trust server certificate
  Connection timeout: 60

[πŸ”Œ Test Connection] [Connect] [Cancel]

After clicking Connect:

Alternative Server Addition:

Server Management Context Menu:

Right-click any server to access:

Behind the Scenes:

Storage Structure:

{
  "Environments": {
    "TEST": {
      "DisplayName": "Test Environment",
      "Servers": [
        {
          "DataSource": "testserver\\SQLEXPRESS",
          "DisplayName": "Test Server",
          "AuthenticationType": "Windows",
          "TrustServerCertificate": true,
          "ConnectTimeout": 30,
          "IsActive": true
        },
        {
          "DataSource": "sqlserver.company.com",
          "DisplayName": "Production SQL",
          "AuthenticationType": "SqlServer",
          "Username": "sa",
          "EncryptedPassword": "AQAAANCMnd8BFdERjHoAwE...(Base64)",
          "TrustServerCertificate": true,
          "ConnectTimeout": 60,
          "IsActive": true
        }
      ]
    }
  }
}

Security Notes:


Step 4: Select a Server

  1. Click on a server in the Server Explorer
  2. Server shows authentication type:
    • ServerName (Windows Auth) - Windows Authentication
    • ServerName (username) - SQL Server Authentication with username shown
  3. The application will:
    • Connect to the server using stored credentials
    • Automatically decrypt SQL Server password if needed
    • Load available databases
    • Update the Database Explorer with databases
    • Show connection status in the bottom status bar

Connection String Built Automatically:


Step 5: Select a Database

  1. In the Database Explorer (middle-left), click on a database name
  2. The application will:
    • Connect to the specific database
    • Load all database objects (Tables, Views, Stored Procedures, Functions)
    • Populate the Object Explorer with organized object types

Step 6: Search for Objects (NEW! πŸ”)

When working with large databases containing hundreds or thousands of objects, the new Object Search feature makes finding specific objects fast and easy.

Search Box Location:

Located directly above the Object TreeView in the Object Explorer section:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Object Explorer                  β”‚
β”‚ Select a database...             β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ πŸ” Search objects...         βœ–  β”‚ ← Search box
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ β–Ά Tables                         β”‚
β”‚ β–Ά Views                          β”‚
β”‚ β–Ά Stored Procedures              β”‚
β”‚ β–Ά Functions                      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Simple Object Name Search:

  1. Click in the search box (or just start typing)
  2. Type part of an object name: GetUser
  3. Results instantly filter to show:
    • dbo.GetUser
    • dbo.GetUserByEmail
    • app.GetUserProfile
    • sales.UserGetOrders
  4. All matching categories and schemas auto-expand
  5. Non-matching items are hidden

Schema-Qualified Search:

  1. Type schema + object: dbo.Get
  2. Results filter to show only dbo schema:
    • dbo.GetUser βœ… (matches)
    • dbo.GetOrder βœ… (matches)
    • app.GetUser ❌ (different schema, hidden)
  3. Searches only within specified schema

Partial Matching:

  1. Type: order
  2. Finds all objects containing "order":
    • dbo.CreateOrder
    • dbo.GetOrderDetails
    • sales.OrderHistory
    • dbo.ProcessCustomerOrder
  3. Works anywhere in object name (not just start)

Search Features:

Real-Time Filtering:

Auto-Expand:

Clear Button:

Status Messages:

πŸ” Search: Found objects matching 'GetUser'
πŸ” Search: No objects found matching 'xyz'

Search Examples:

Example 1: Find All User-Related Procedures

Type: User

Results:
β–Ό Stored Procedures
  β–Ό dbo
    GetUser
    GetUserByEmail
    UpdateUser
    DeleteUser
  β–Ό app
    GetUserProfile
    ValidateUser

Example 2: Find Specific Schema Objects

Type: dbo.sp

Results:
β–Ό Stored Procedures
  β–Ό dbo
    sp_GetCustomers
    sp_UpdateOrder
    sp_ProcessPayment

Example 3: Find Views with "Order"

Type: order

Results:
β–Ό Views
  β–Ό dbo
    vw_ActiveOrders
    vw_OrderHistory
  β–Ό sales
    vw_MonthlyOrders
β–Ό Stored Procedures
  β–Ό dbo
    CreateOrder
    ProcessOrder

(Shows views AND procedures with "order")

Search Behavior:

Case-Insensitive:

Auto-Reset:

Preserved Tree Structure:

Search Scope:

Tips for Effective Searching:

  1. Start Broad, Then Narrow:

    Type: Get        β†’ 50 results
    Type: GetUser    β†’ 5 results
    Type: dbo.GetU   β†’ 2 results
    
  2. Use Schema Prefix for Precision:

    Without schema: User     β†’ All schemas
    With schema:    dbo.User β†’ Only dbo schema
    
  3. Search by Functionality:

    Search: report   β†’ All reporting objects
    Search: insert   β†’ All insert operations
    Search: validate β†’ All validation procedures
    
  4. Clear Between Searches:

    • Click βœ– after each search to reset
    • Keeps tree clean and organized
  5. Works with Any Object Type:

    • Tables: dbo.Customers
    • Views: vw_Orders
    • Procedures: sp_GetData
    • Functions: fn_Calculate

Issue: "No results found"

Issue: "Search not working"

Issue: "Search too slow"


Step 6a: SQL Formatting Preferences (NEW! πŸ’Ž)

SODA+ AI includes a powerful SQL formatting system that allows you to customize how SQL code is formatted when you click the πŸ’Ž Format button in the Dependency Analyzer.

Why Use SQL Formatting Preferences?

Opening SQL Formatting Preferences:

Method 1: Tools Menu (Recommended)

  1. Go to Tools menu (top menu bar)
  2. Select SQL Formatting Preferences
  3. Dialog opens with current settings

Method 2: Keyboard Shortcut

Dialog Layout:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ SQL Formatting Preferences                      β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ πŸ“‹ My Preferences β”‚ ⭐ Organization Template    β”‚ ← Tabs
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ LEFT: Settings                                   β”‚
β”‚ β€’ Keyword Casing                                 β”‚
β”‚ β€’ Indentation Size                               β”‚
β”‚ β€’ New Line Options (18 checkboxes)              β”‚
β”‚                                                  β”‚
β”‚ RIGHT: Live Preview                              β”‚
β”‚ β€’ Sample SQL formatted with current settings    β”‚
β”‚ β€’ Updates as you change options                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚ πŸ’Ύ Save My Preferences β”‚ πŸ”„ Reset β”‚ ❌ Cancel   β”‚ ← Buttons
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Formatting Options:

1. Keyword Casing (3 options)

2. Indentation Size

3. New Line Options (18 checkboxes)

Clause Placement:

Alignment:

Multiline Lists:

Indentation:

Parentheses:

Using the Live Preview:

The right panel shows a live preview of how SQL will be formatted with your current settings.

Preview Features:

Example Preview:

Before (Compact):

SELECT u.UserId, u.Name FROM Users u WHERE u.Active = 1 ORDER BY u.Name

After (IndentationSize=8, UPPERCASE, New Lines ON):

SELECT  u.UserId,
        u.Name
FROM    Users u
WHERE   u.Active = 1
ORDER BY u.Name

Saving Your Preferences:

Personal Preferences:

  1. Adjust settings in "My Preferences" tab
  2. Review preview to confirm
  3. Click πŸ’Ύ Save My Preferences
  4. Success message: "Your personal formatting preferences have been saved successfully"
  5. Settings saved to cloud (Azure Functions + Database)
  6. Format button in Dependency Analyzer now uses YOUR settings

What Gets Saved:

Organization Templates (Admins Only):

If you have IsOrganizationAdmin role, you'll see a second tab:

⭐ Organization Template Tab

Purpose:

How to Save Organization Template:

  1. Switch to "Organization Template" tab
  2. Adjust settings to desired defaults
  3. Click ⭐ Save as Organization Template
  4. Confirmation dialog:
    Save these settings as the organization-wide default?
    
    This will affect all users in your organization who haven't
    created personal overrides.
    
    [Yes] [No]
    
  5. Click Yes to confirm
  6. Success message: "Organization template saved successfully! All users in your organization will now use these settings by default."
  7. Settings saved to ConfigurationTemplates table
  8. All users without personal overrides will use these settings

Who Sees This Tab:

Hierarchical Configuration:

SODA+ AI uses a 3-tier hierarchy for SQL formatting:

1. Hard-Coded Defaults (Built-in)
   ↓
2. Organization Template (Admin sets)
   ↓
3. User Overrides (Your personal settings)

Priority: User Overrides > Organization Template > Hard-Coded Defaults

Example:

Reset to Defaults:

Button: πŸ”„ Reset to Defaults

Action:

  1. Click Reset button
  2. Confirmation dialog:
    Reset all settings to shop defaults?
    
    This will discard any personal overrides you've made.
    
    [Yes] [No]
    
  3. Click Yes to confirm
  4. All settings revert to organization template (or hard-coded defaults)
  5. Does NOT save automatically - must click "Save My Preferences"

When to Use:

Format Button Integration:

After saving preferences, the πŸ’Ž Format button in Dependency Analyzer will automatically use your settings.

Workflow:

1. Open Dependency Analyzer for stored procedure
   ↓
2. View SQL code in right panel
   ↓
3. Click πŸ’Ž Format button (toolbar)
   ↓
4. System loads YOUR formatting preferences from cloud
   ↓
5. Applies preferences using SqlFormatter
   ↓
6. Code updates with YOUR indentation, casing, etc.
   ↓
7. Status: "βœ… SQL formatted using SQL Server 2022 (using your preferences)"

Status Messages:

Behind the Scenes:

Technology Stack:

Data Flow:

1. You click "Save My Preferences"
   ↓
2. Client serializes 20 options to JSON
   ↓
3. PUT /api/configuration/override
   Headers: X-Session-Token, X-User-Id
   Body: { userId, templateName, overrideData }
   ↓
4. Azure Functions validates session token
   ↓
5. Saves to UserConfigurationOverrides table
   ↓
6. Returns 200 OK
   ↓
7. Client shows success message

Loading Preferences:

1. You click πŸ’Ž Format button
   ↓
2. Client calls callback to load preferences
   ↓
3. GET /api/configuration/{userId}/SqlFormatter
   Headers: X-Session-Token, X-User-Id
   ↓
4. Azure Functions validates session
   ↓
5. Queries UserConfigurationOverrides table
   ↓
6. Merges with organization template (if any)
   ↓
7. Returns merged configuration JSON
   ↓
8. SqlFormatter uses your preferences

Security Features:

Session-Based Authentication:

User Isolation:

Admin Controls:

Example Scenarios:

Scenario 1: New User (First Time)

1. Open SQL Formatting Preferences
2. Default settings loaded (hard-coded or org template)
3. Change IndentationSize to 8
4. Change KeywordCasing to lowercase
5. Click "Save My Preferences"
6. βœ… Settings saved to cloud
7. Format button now uses 8-space, lowercase

Scenario 2: Admin Setting Org Template

1. Admin opens SQL Formatting Preferences
2. Switch to "Organization Template" tab
3. Set IndentationSize = 4 (company standard)
4. Set KeywordCasing = UPPERCASE
5. Click "Save as Organization Template"
6. Confirm dialog
7. βœ… All users without overrides now use 4-space, UPPERCASE

Scenario 3: User Overriding Org Template

1. Org template: IndentationSize = 4
2. User prefers 8-space indentation
3. Open SQL Formatting Preferences
4. "My Preferences" tab shows 4 (org template)
5. Change to 8
6. Click "Save My Preferences"
7. βœ… User's format button now uses 8 (override wins)
8. Other users still use 4 (org template)

Troubleshooting:

Issue: "Preferences not saving"

Issue: "Format button not using my preferences"

Issue: "Organization Template tab missing"

Issue: "Preview not updating"

Issue: "Settings lost after restart"

Tips for Best Results:

  1. Start with Defaults - Don't change everything at once
  2. Use Preview - See changes before saving
  3. Test on Complex SQL - Verify with real procedures
  4. Match Team Style - Coordinate with colleagues
  5. Document Standards - Share org template settings
  6. Indentation Sweet Spots:
    • 2 spaces - Compact, laptop-friendly
    • 4 spaces - Industry standard (recommended)
    • 8 spaces - High visibility, presentations
  7. Keyword Casing:
    • UPPERCASE - Traditional SQL style (most common)
    • lowercase - Modern style, easier to type
    • PascalCase - Rare, but some teams prefer
  8. New Lines ON - More readable for complex queries
  9. Multiline Lists ON - Better for long SELECT lists
  10. Save Often - Settings persist across sessions

What's NOT Configurable:

The formatter has some fixed behaviors that cannot be changed:

Supported SQL Server Versions:

The formatter supports all modern SQL Server versions:

Auto-detection: Formatter detects SQL Server version from connection string.


Step 7: Analyze Database Objects (ENHANCED! 🎯)

Now with enhanced context menu and direct charting support for Views!

  1. In the Object Explorer, navigate to your target object:
    • Expand Tables, Views, Stored Procedures, or Functions
    • Expand schema folders (e.g., dbo, custom schemas)
    • Use search box to quickly find objects (see Step 6)
  2. Right-click on any object to see analysis options:

Analysis Options:

What's New for Views:

Previously, charting was only available for Stored Procedures and Functions. Now, Views are fully supported for all three chart types:

Why Chart Views?

Chart Types for Views:

  1. πŸ“Š Quick Chart (Views)

    • Shows tables, views, and functions referenced by the view
    • Fast generation (< 1 second)
    • No AI required
    • Example: vw_CustomerOrders β†’ Shows Customers, Orders, OrderDetails tables
  2. πŸ€– AI-Enhanced Chart (Views)

    • Analyzes view's SQL SELECT statement
    • Identifies JOIN patterns and relationships
    • Groups related tables logically
    • Adds annotations for complex logic
    • Example: AI might group "Customer Info" tables vs "Order Info" tables
  3. πŸ“ˆ Logic Flowchart (Views)

    • Visualizes CASE statements in view definition
    • Shows conditional logic flow
    • Analyzes UNION/INTERSECT/EXCEPT operations
    • Maps subquery relationships
    • Example: View with complex CASE logic β†’ Flowchart shows decision tree

Example View Charting Workflow:

1. Right-click on vw_CustomerOrderSummary
2. Select: Chart Analysis β†’ Quick Chart
3. Chart window opens showing:
   
   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
   β”‚ vw_CustomerOrderSummary β”‚ (Your View)
   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
             β”‚
        β”Œβ”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚           β”‚           β”‚          β”‚
   β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β” β”Œβ”€β”€β”€β–Όβ”€β”€β”€β” β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β” β”Œβ”€β”€β–Όβ”€β”€β”
   β”‚Customersβ”‚ β”‚ Orders β”‚ β”‚OrderDtlsβ”‚ β”‚Prodsβ”‚
   β”‚ (Table) β”‚ β”‚(Table) β”‚ β”‚ (Table) β”‚ β”‚(Tab)β”‚
   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”˜

4. Click "AI-Enhanced Chart" for deeper analysis
5. AI identifies:
   - Customer demographic group
   - Order transaction group
   - Product catalog group

Method 2: Single-Click Selection

  1. Single-click any object in the Object Explorer
  2. The object will be selected and analysis will load in the main work area
  3. Use the menu bar options: Analyze β†’ Dependencies

Step 8: Review Analysis Results

Dependency Analysis - Multi-Tab Architecture ⭐ UPDATED!

Dependency Analyzer
Figure 3: Dependency Analyzer showing LEFT panel (3 sub-tabs: Downstream, Upstream, Call Order) and RIGHT panel (SQL Code Viewer with search)

The Dependency Analyzer features a powerful multi-tab architecture that lets you analyze multiple objects simultaneously:

Two-Level Tab System:

Level 1: Main Window Analyzer Tabs (Top Level)

Level 2: Within Each Analyzer Tab (Split Panel Layout)

Managing Multiple Analyzer Tabs:

Opening New Tabs:

Action: Right-click object β†’ Analyze Dependencies
Result: 
  - NEW tab opens in main work area (or switches to existing if already open)
  - Tab header: [Icon] ObjectName βœ–
  - Tab count updates: "(3 objects)" in work area header
  - Work area title updates: "Analyzing: ObjectName"

Tab Features:

Tab Operations:

Example Multi-Tab Scenario:

Main Window has 3 tabs open:

Tab 1: πŸ“‹ dbo.ProcessOrder βœ–
  β”œβ”€ Downstream (5 objects)
  β”œβ”€ Upstream (8 objects)  
  └─ Call Order (13 items)

Tab 2: πŸ“Š dbo.Customers βœ–
  β”œβ”€ Downstream (23 objects) ← Many procedures use this table!
  β”œβ”€ Upstream (0 objects) ← Tables don't depend on other objects
  └─ Call Order (0 items)

Tab 3: πŸ”§ dbo.CalculateTax βœ–
  β”œβ”€ Downstream (12 objects)
  β”œβ”€ Upstream (3 objects)
  └─ Call Order (4 items)

User can switch between tabs to compare dependencies!

LEFT PANEL: Dependency Sub-Tabs

Each analyzer tab contains 3 sub-tabs in the left panel:

1. ⬇️ Downstream Dependencies Sub-Tab

2. ⬆️ Upstream Dependencies Sub-Tab

3. πŸ“Š Call Order Sub-Tab

RIGHT PANEL: SQL Code Viewer

The right panel shows SQL code for selected objects:

Code Viewer Features:

How Code Viewer Works:

  1. Click any object in Downstream/Upstream trees
  2. Right panel updates to show that object's SQL definition
  3. Use search box to find specific code within displayed object
  4. Breadcrumb shows which object's code is displayed

Understanding the Tabbed Workflow:

Quick Navigation:

Typical Multi-Object Analysis Flow:

Step 1: Analyze dbo.GetCustomerOrders
  β†’ New tab opens: "πŸ“‹ dbo.GetCustomerOrders βœ–"
  β†’ Left panel has 3 sub-tabs populated
  β†’ Right panel shows dbo.GetCustomerOrders code

Step 2: In UPSTREAM sub-tab, see dependency: dbo.ValidateCustomer
  β†’ Right-click dbo.ValidateCustomer β†’ Analyze Dependencies
  β†’ NEW TAB opens: "πŸ“‹ dbo.ValidateCustomer βœ–"
  β†’ Original tab still open - can switch back!

Step 3: In new tab, explore dbo.ValidateCustomer dependencies
  β†’ Check UPSTREAM: What does ValidateCustomer need?
  β†’ Review downstream effects on: vw_ActiveOrders, DailyOrderReport
  β†’ Click GetCustomerOrders in tree β†’ Right panel shows its code

Step 4: Switch back to first tab (click "πŸ“‹ dbo.GetCustomerOrders βœ–")
  β†’ All state preserved: expanded nodes, selections, etc.
  β†’ Review impact across multiple dependent objects
  β†’ Copy object names for impact documentation

Visual Indicators in Dependency Trees:

Dependency Depth:

Object Type Icons:

Tree Node Tooltips:

Sub-Tab Specific Features:

Downstream Sub-Tab - Impact Analysis Tools:

Upstream Sub-Tab - Dependency Tracking:

Call Order Sub-Tab - Execution Sequence:

Example: Analyzing a Stored Procedure

Scenario: Analyzing dbo.ProcessCustomerOrder

Main Tab Opens: πŸ“‹ dbo.ProcessCustomerOrder βœ–

UPSTREAM Sub-Tab Shows:

Count: 4

πŸ” Search dependencies...

  πŸ“Š dbo.Customers (Table) - Level 1
  πŸ“Š dbo.Orders (Table) - Level 1
  πŸ“‹ dbo.ValidateCustomer (Procedure) - Level 1
    πŸ“Š dbo.CustomerCache (Table) - Level 2  ← Nested!
  πŸ”΄ dbo.CalculateTax (Function) - Level 1

Interpretation: This procedure needs these 4 direct objects (+ 1 nested) to execute

DOWNSTREAM Sub-Tab Shows:

Count: 3

πŸ” Search dependencies...

  πŸ“‹ dbo.DailyOrderReport (Procedure) - Level 1
  πŸ“‹ dbo.CustomerPortal_SubmitOrder (Procedure) - Level 1
  πŸ‘οΈ vw_ActiveOrders (View) - Level 1

Interpretation: These 3 objects will break if you change this procedure

Call Order Sub-Tab Shows:

[Generate Call Order]  ← Click to populate

After clicking:

1. dbo.CustomerCache
2. dbo.ValidateCustomer
3. dbo.Customers
4. dbo.Orders
5. dbo.CalculateTax
6. dbo.ProcessCustomerOrder  ← Our object

RIGHT PANEL Shows:

-- Code Title: dbo.ProcessCustomerOrder
-- Breadcrumb: SERVER01.MyDatabase.dbo.ProcessCustomerOrder

πŸ” Search in code...

CREATE PROCEDURE dbo.ProcessCustomerOrder
    @CustomerId INT,
    @OrderId INT
AS
BEGIN
    -- Validate customer exists
    EXEC dbo.ValidateCustomer @CustomerId
    
    -- Calculate tax
    DECLARE @Tax DECIMAL(10,2)
    SELECT @Tax = dbo.CalculateTax(@OrderId)
    
    -- Insert order
    INSERT INTO dbo.Orders (CustomerId, OrderId, Tax)
    SELECT @CustomerId, @OrderId, @Tax
    FROM dbo.Customers WHERE Id = @CustomerId
END

User clicks dbo.ValidateCustomer in tree:

Benefits of the Multi-Tab Architecture:

βœ… Simultaneous Analysis

βœ… Organized Information

βœ… Faster Navigation

βœ… Better Context

βœ… Enhanced Workflow

Tips for Effective Multi-Tab Use:

  1. Start with Root Object - Open your main object first
  2. Drill Down Strategically - Right-click β†’ Analyze to open dependencies in new tabs
  3. Use Tab Switching - Ctrl+Tab to navigate between analyzed objects
  4. Close Unused Tabs - Click βœ– to keep workspace clean
  5. Watch Tab Count - Max 10 tabs, close some if limit reached
  6. Compare Side-by-Side - Switch tabs to compare Upstream/Downstream
  7. Use Right Panel - Click items in trees to see their code
  8. Search Within Tabs - Each tab has independent search
  9. Adjust Depth Per Tab - Toolbar depth setting is per-tab
  10. Check Work Area Title - Confirms which object you're viewing
  11. Use Call Order for deployment - shows sequence for script generation
  12. Hover over tabs for details - see object info and tab actions
  13. Look for Linked Server indicators - πŸ”— shows cross-server dependencies
  14. Check Cross-Database indicators - πŸ“‚ shows objects in other databases

Common Multi-Tab Patterns:

Pattern 1: Chain Analysis

Tab 1: Main Procedure (your starting point)
Tab 2: Helper Procedure (called by main)
Tab 3: Validation Function (called by helper)
Tab 4: Base Table (used by validation)

β†’ See the complete chain across 4 tabs!

Pattern 2: Impact Assessment

Tab 1: Table you want to modify
Tab 2: Procedure A that uses it (from Downstream)
Tab 3: Procedure B that uses it (from Downstream)
Tab 4: View C that uses it (from Downstream)

β†’ Assess impact on all 3 dependent objects!

Pattern 3: Comparison Analysis

Tab 1: dbo.GetCustomerOrders
Tab 2: dbo.GetSupplierOrders
Tab 3: dbo.GetProductOrders

β†’ Compare similar procedures side-by-side!

Step 8: AI Code Analysis - ENHANCED WORKFLOW! πŸŽ‰

AI Review Window
Figure 6: AI Review window with three tabs - Sent Prompt, AI Response, and Formatted View

When you select an AI analysis option, a dedicated AI Review window opens with:

Three Main Tabs:

  1. πŸ“€ Sent Prompt Tab

    • Shows the exact prompt being sent to AI
    • Displays object details (name, type, environment)
    • Shows configuration (model, temperature, max tokens)
    • Full prompt text with system instructions
    • Helps you understand what's being analyzed
  2. πŸ€– AI Response Tab

    • Real-time AI analysis results in plain text format
    • Clean, readable Consolas font display
    • Right-click context menu for:
      • Copy response
      • Copy all text
      • Select all
    • Full conversation history preserved
    • Best for copying text to other tools
  3. ✨ Formatted View Tab - NEW! πŸ†•

    • Beautiful HTML rendering of AI responses
    • Syntax highlighting for SQL and C# code blocks
    • Collapsible sections - Click headers to expand/collapse content
    • Copy buttons on code blocks - One-click copy to clipboard
    • Dark/Light theme toggle - Click "β˜€οΈ Light" / "πŸŒ™ Dark" button
    • Search functionality - Find text with Ctrl+F-style search bar
    • Table of Contents - Auto-generated for responses with 3+ headers
    • Interactive features:
      • Hover over code blocks to see copy button
      • Click section headers to collapse/expand
      • Use search navigation (Previous/Next buttons)
      • Scroll to navigate long responses
    • Professional appearance - Great for screenshots and presentations
    • WebView2-powered - Modern web rendering engine

Using the Formatted View Tab:

Initial Load:

Interactive Features:

When to Use Each Tab:
| Tab | Best For |
|-----|----------|
| Sent Prompt | Understanding what was sent to AI, debugging prompts |
| AI Response | Copying plain text, searching with Ctrl+F, archiving |
| Formatted View | Reading analysis, screenshots, presentations, interactive exploration |

Pro Tips:

Troubleshooting Formatted View:
Issue: "WebView2 initialization failed"

Issue: Formatted view is blank

Issue: Code blocks not rendering correctly

Issue: Search not finding text

Issue: Theme toggle not working


Step 10: Dependency Charting (NEW!) πŸ“Š

What is Dependency Charting?

Dependency Charting visualizes the relationships between database objects using Mermaid diagrams. SODA+ AI offers three powerful charting options to fit your needs:

  1. Quick Chart (Self-Contained) - Fast, database metadata-only
  2. AI-Enhanced Chart - Intelligent analysis with optimized layouts
  3. Logic Flowchart - Control flow analysis from SQL code

Chart Generation Options:

πŸ“Š Quick Chart (Self-Contained) - Recommended for most scenarios

πŸ€– AI-Enhanced Chart - For complex analysis

πŸ“ˆ Logic Flowchart - Control flow visualization

Charting for Views (NEW! πŸ†•)

Views can now be charted just like Procedures and Functions!

Why Chart Views?

All Three Chart Types Work for Views:

Right-click on vw_CustomerOrders (View)
β†’ Chart Analysis
β†’ Quick Chart βœ… Enabled
β†’ AI-Enhanced Chart βœ… Enabled  
β†’ Logic Flowchart βœ… Enabled

Generating a Dependency Chart:

Method 1: Context Menu (Quick Access)

  1. Right-click on any Procedure, Function, or View ⭐ UPDATED!
  2. Select πŸ“Š Chart Analysis submenu
  3. Choose from three chart options:
    • πŸ“Š Quick Chart - Instant results
    • πŸ€– AI-Enhanced Chart - Deep AI analysis
    • πŸ“ˆ Logic Flowchart - Control flow diagram

Method 2: Menu Bar

  1. Select a Procedure, Function, or View
  2. Go to Visualize β†’ Generate Chart
  3. Chart Analysis submenu appears with all three options

Quick Chart Workflow:

Step 1: Generate Chart

  1. Right-click object β†’ Chart Analysis β†’ Quick Chart
  2. Chart window opens to the right of main window
  3. Mermaid code auto-generated from database dependencies
  4. Shows node/edge count in status bar

Dependency Chart Window
Figure 7: Chart window showing generated Mermaid code and dependency visualization

Step 2: Review Diagram

Step 3: Save and Render

  1. Click πŸ’Ύ Save .mmd to save Mermaid source
  2. Click 🎨 Render SVG to create graphic (1200x800px)
  3. Click πŸ–ΌοΈ Open SVG to view in browser
  4. Fully scalable vector graphic

AI-Enhanced Chart Workflow:

Step 1: Launch AI Chart

  1. Right-click object β†’ Chart Analysis β†’ AI-Enhanced Chart
  2. System retrieves SQL code for the object
  3. Chart window opens with AI capabilities enabled
  4. Button shows: "AI Generate Chart"

Step 2: Generate with AI

  1. Click AI Generate Chart button
  2. System prompts for API key (if not configured)
  3. AI analyzes:
    • SQL code structure and logic
    • Database dependencies (DEPENDS ON / DEPENDED ON BY)
    • Control flow and decision points
    • Multi-level dependency chains
  4. Progress: "Calling AI for enhanced chart generation..."
  5. Can click Cancel to abort

Step 3: Review AI Output

Step 4: Refine and Export

  1. Edit Mermaid code if needed (fully editable)
  2. Save .mmd file
  3. Render to SVG
  4. Open in browser
  5. Use in documentation

Comparing Chart Types:

Feature Quick Chart AI-Enhanced Chart Logic Flowchart
Speed < 1 second 5-30 seconds 5-30 seconds
Cost Free Uses API credits Uses API credits
Offline βœ… Yes ❌ No ❌ No
Shows Dependencies βœ… Yes βœ… Yes Partial
SQL Analysis ❌ No βœ… Yes βœ… Yes
Control Flow ❌ No Partial βœ… Yes
Layout Optimization Basic βœ… AI-optimized βœ… AI-optimized
Best For Quick checks Complex dependencies Logic understanding
Procedures βœ… Yes βœ… Yes βœ… Yes
Functions βœ… Yes βœ… Yes βœ… Yes
Views βœ… Yes ⭐ βœ… Yes ⭐ βœ… Yes ⭐

When to Use Each Chart Type:

Use Quick Chart When:

Use AI-Enhanced Chart When:

Use Logic Flowchart When:


Step 11: Working with AI Analysis Types

Summary Analysis

Low Hanging Improvements

Deeper Improvements (Progressive Levels 1-4)

Security Analysis

Performance Analysis

Best Practices

Refactoring Suggestions


Step 12: Advanced AI Features

Custom Prompts

At the bottom of the AI Review window:

  1. Enter your own custom question or prompt
  2. Click "πŸš€ Send Custom"
  3. Get AI response specific to your question
  4. Maintains conversation context
  5. Useful for follow-up questions
  6. Response appears in all three tabs - Plain text and formatted view

Formatted View Interactions

After receiving AI response:

Session Management

File Menu Options:

Session Storage Includes:

Analysis Type Switching

Keyboard Shortcuts in AI Review Window

Shortcut Action Tab
Ctrl+C Copy selected text AI Response
Ctrl+S Save session Any
Alt+F4 Close window Any
Ctrl+Tab Cycle through tabs Any
Ctrl+F Search (native browser search) Formatted View
Enter Search (custom search bar) Formatted View

Step 13: Navigation and Workspace Management

Panel Management

View Menu Options


Advanced Features

Server Management

Environment Switching

Message Panel

Keyboard Shortcuts


Typical AI Analysis & Refactoring Workflow

  1. Select Environment β†’ Choose SANDBOX/TEST/PROD
  2. Add Server β†’ Right-click Server Explorer β†’ Add Server
  3. Connect β†’ Click server name
  4. Choose Database β†’ Click database in Database Explorer
  5. Find Object β†’ Navigate in Object Explorer (Procedures/Functions/Views/Tables)
  6. Start Analysis β†’ Right-click β†’ Choose analysis type:
    • Dependencies β†’ Opens analyzer tab with sub-tabs (Downstream/Upstream/Call Order)
    • AI Analysis β†’ Opens AI Review window (Procedures/Functions only)
    • Chart Analysis β†’ Opens chart window (Procedures/Functions/Views)
  7. Review Results β†’ Check analysis/chart output in appropriate tabs/windows
  8. For Dependency Analysis:
    • Main Tab Opens: New analyzer tab appears (e.g., "πŸ“‹ dbo.MyProcedure βœ–")
    • Work Area Title Updates: "Analyzing: MyProcedure"
    • Review LEFT PANEL Sub-Tabs: Downstream, Upstream, Call Order
    • Inspect RIGHT PANEL: View SQL code and use search

End of User Guide | Version: 2.5 | Last Updated: December 31, 2025

↑ Top