Import a schema

AI in schema import

A script import uses AI at several points. Knowing where helps you judge the result and fix what it gets wrong.

1. Splitting the script

For smaller scripts, AI reads the whole file, breaks it into objects (tables, views, procedures and so on), and works out their dependency order so tables come before the views that read them. Larger scripts are split by pattern first, without AI, for speed.

AI also cleans noise, such as GO separators, SET statements and SSMS headers, out of view, procedure and function bodies before they’re stored.

2. Parsing tables

Each table’s DDL is parsed by AI into columns, data types, keys, defaults and constraints. Columns limited to a list of values become enums.

3. Applying descriptions

If the script contains description statements (sp_addextendedproperty, COMMENT ON and similar), AI matches each one to the right table, column, view, procedure, function or parameter and applies it.

Note: The import doesn’t invent descriptions. Objects without a description statement in the script are left blank. Use Generate Descriptions afterwards if you want AI-written ones.

4. Analyzing SQL objects

After each view, procedure and function is created, it’s queued for analysis, which extracts its outputs, parameters and dependencies.

5. Explaining failures

When an item fails, the Fix & Retry dialog shows What went wrong: AI’s plain-English reading of the raw error. The raw text is still there under Show technical error. See Fix failed import items.

What you control

  • Whether to import at all, and from which file.
  • How to edit a failed item’s DDL before you retry it.
  • Whether to generate descriptions afterwards.

What AI does not do

  • It doesn’t connect to your database. A script import only reads the text you give it.
  • It doesn’t change your file.
  • It doesn’t overwrite objects that already exist in the schema.
  • It doesn’t retry failed items on its own.

Tip: AI parsing is good but not perfect. Spot-check a few tables after an import. See After the import finishes.