SQL Object Impact Analysis

SQL Object Impact Analysis

Traces every reference to a table, column, stored procedure, view or trigger across SQL and application code and produces a blast-radius report before a change.

Skill files1 file
SKILL.md65 lines
1
---
2
name: sql-object-impact-analysis
3
description: "Before modifying a table, column, stored procedure, view, or trigger in a legacy codebase, trace every place that references it — across other SQL objects (procs, views, triggers) AND application code (C#, Angular/TypeScript, JS, or any language in the repo) — and produce a structured blast-radius report so you know what breaks before you change it. Use when the user asks 'what uses this column/table/procedure', 'is it safe to change X', 'what depends on this', 'impact of renaming/dropping X', or before any schema/proc modification in an unfamiliar or legacy codebase. Not for privacy/PII exposure analysis (see data-breach-blast-radius) or query performance tuning (see sql-optimization)."
4
---
5
6
# SQL Object Impact Analysis
7
8
You are performing a **pre-change dependency trace** for a database object (table, column, stored procedure, view, function, or trigger) inside a legacy or unfamiliar codebase. The goal is a single, trustworthy answer to: *"If I change this, what else is affected?"*
9
10
## When to use this
11
12
Trigger when the user:
13
- Names a specific table, column, stored procedure, view, or trigger and asks what uses it, what depends on it, or whether it's safe to change/rename/drop
14
- Is about to modify a schema element in a codebase with no ORM, or a mixed legacy stack (raw SQL + stored procs + hand-written data access code)
15
- Asks for a "blast radius," "impact analysis," or "dependency trace" of a specific DB object
16
17
Do not use this for:
18
- General SQL performance tuning (use `sql-optimization`)
19
- SQL code quality/security review (use `sql-code-review`)
20
- Privacy/PII exposure analysis (use `data-breach-blast-radius`)
21
- Architecture-level documentation of an entire codebase (use `doc-and-modernize`)
22
23
## Process
24
25
1. **Confirm the target object and its exact name(s).** Ask if ambiguous (e.g., multiple tables with similar names, or the user says "the customer table" without specifying schema). Get the precise identifier before searching.
26
27
2. **Search the SQL layer first:**
28
- Search all `.sql` files, stored procedure definitions, views, functions, and triggers in the repo/database scripts folder for direct references to the object name
29
- For a column: check every proc/view/trigger that selects, inserts, updates, or filters on it
30
- For a table: check every proc/view/trigger that references it, plus foreign key relationships to/from other tables
31
- For a stored procedure: check every other proc that calls it, and every scheduled job/agent step that invokes it
32
- Note indirect references too — dynamic SQL (`EXEC(@sql)`), synonyms, and views built on views
33
34
3. **Search the application layer:**
35
- Search all application code (C#, Java, JS/TS, Angular, whatever the repo contains) for:
36
- Direct SQL strings referencing the object name
37
- ORM/data-access-layer method or class names that map to it (e.g., a repository method calling the stored procedure)
38
- API endpoint handlers that ultimately call into the affected data path
39
- Trace one layer further where reasonable: does a frontend component consume an endpoint that touches this object? Note it, but don't chase every UI consumer exhaustively — flag "further downstream consumers likely exist" if the trail runs cold rather than guessing.
40
41
4. **Classify each finding by confidence:**
42
- **Direct** — object name found verbatim in code/SQL
43
- **Indirect** — reached via a proc call chain, ORM mapping, or dynamic SQL that couldn't be fully resolved statically
44
- **Uncertain** — plausible but unverified (e.g., dynamic SQL construction that couldn't be traced to a literal object name)
45
- Never present an Uncertain finding as if it were Direct — flag it clearly so the reader knows to verify manually
46
47
5. **Produce the report** (see Output Format below).
48
49
## Output Format
50
51
Always structure the report as:
52
53
1. **Target Object** — exact name, type (table/column/proc/view/trigger), and schema
54
2. **Direct SQL Dependents** — list of procs/views/triggers/functions that reference it directly, grouped by object type
55
3. **Application Code Dependents** — list of files/classes/methods that reference it, grouped by layer (data access, API/service, frontend), with file paths
56
4. **Indirect / Dynamic References** — anything found via dynamic SQL, synonyms, or call chains that couldn't be fully resolved — labeled clearly as needing manual verification
57
5. **Risk Summary** — one paragraph: is this object narrowly used (low risk) or widely fanned-out (high risk)? Call out anything that touches a scheduled job, external integration, or reporting layer specifically, since those often get missed
58
6. **Suggested Verification Steps** — concrete next actions before making the change (e.g., "run these two procs against staging data first," "check if the ReportingService endpoint at X depends on this column")
59
60
## Guidelines
61
62
- Never claim a dependency is complete or exhaustive — static text search cannot catch every dynamic SQL construction or reflection-based ORM mapping. State the search method used and its limits explicitly in the report.
63
- Never fabricate a file path, proc name, or line reference. If you searched and found nothing, say "no references found via text search" — not silence, and not an invented result.
64
- If the codebase is large enough that a full trace isn't feasible in one pass, say so and propose scoping (e.g., "search only the `Orders` module first") rather than silently producing a partial report as if it were complete.
65
- Keep the report scannable — this is a pre-change safety check someone will read in a few minutes before making a decision, not a full architecture document.

© GitHub, Inc. · MIT · source · posted by @OpenSourceBuffGuy on promptparty.com

@OpenSourceBuffGuy

I find openly licensed prompts and post them here.

0 followers · 13,409 prompts

More by @OpenSourceBuffGuy

See all
Swordswoman faces colossal robed figure in industrial yard prompt image

Swordswoman faces colossal robed figure in industrial yard

Writes a two-scene, 20-second live-action video prompt in which a swordswoman freezes a colossal figure with realistic ice and shatters him with a finishing slash.

video-prompt, seedance, action, martial-arts, visual-effects, multi-shot, cinematic, character-consistency, timed-beats, negative-prompt, guardrails, structured-output, photorealistic, fantasy-world, japan, camera-movement, slow-motion, blue-hour, widescreen, advanced, long-form, for-filmmakers, sound-effects, creatures, warriors

Overhead portrait of a girl lying in snow prompt image

Overhead portrait of a girl lying in snow

Creates an overhead portrait of a girl in a school blazer lying in fresh snow, using a JSON spec that keeps the reference face and sets camera, outfit and soft overcast light.

image-prompt, json-prompt, nano-banana, reference-image, face-reference, negative-prompt, photorealistic, portrait, woman, close-up, high-angle, winter, soft-lighting, natural-light, bokeh, moody, editorial, vertical-format, muted-colors, limited-palette, film-grain, cinematic, structured-output, for-photographers, for-artists

Morning skincare ritual ending on serum hero shot prompt image

Morning skincare ritual ending on serum hero shot

Produces a 15-second skincare commercial from an uploaded storyboard, with eight timed match-cut shots ending on a serum hero shot.

video-prompt, video-ad, product-video, multi-shot, timed-beats, scene-transitions, camera-movement, macro, reference-image, storyboard, character-consistency, skincare, beauty, advertising, photorealistic, cinematic, natural-light, woman, hailuo, tracking-shot, slow-motion, for-marketers, long-form

Reviews

Loading reviews…

Discussion

Loading comments…