AI powered code conversion¶
AI code conversion (or AI-powered code conversion) strengthens the migration process by using AI agents to convert more objects through automated functional validation of converted database code. It uses synthetic data generation, AI-driven unit testing, and AI-driven resolution of errors identified in the deterministic code conversion step, where error warnings and issues (EWIs) and functional difference messages (FDMs) flag conversion issues—along with an intelligent layer in the Snowflake Service that proactively converts code, verifies correctness, resolves errors, and accelerates confidence.
During migration, deterministic logic is first used to translate the source code, surfacing EWIs and FDMs when it cannot automatically resolve certain patterns. Then, AI code conversion is used to reduce manual remediation effort, identify and resolve issues earlier in the process, and provide assurance to users that the converted objects behave as expected.
Key features of AI code conversion¶
AI 検証の加速:手動テストに費やす時間とリソースを大幅に削減します。
自動テスト生成:エージェントが、既存のクエリとビジネスロジックに基づいてテストケースを自動的に生成します。
エージェントによる修復提案:エージェントが、レガシーシステムとSnowflakeの間で一貫した結果を得られるように、既存コードへのパッチを提案します。
Prerequisites for AI code conversion¶
Before you get started with AI code conversion, complete the following steps:
SnowConvert AI をダウンロードしてインストールします。
[推奨] 従前の SQL サーバーコードを SnowConvert AI を使って変換します。
テストおよび開発用に特別に指定されたアカウントを接続します。実稼働アカウントの使用は避けてください。
Some objects will be created as part of the AI code conversion process.
確実に、接続するアカウントの PUBLIC ロールが実稼働データへのアクセス権を持っておらず、CREATE USER コマンドなどの機密操作の実行権限を持っていないようにします。
Ensure that the role used for AI code conversion has the following privileges on the account:
CREATE DATABASE
CREATE に MIGRATION
アカウントでCortex AI SQL 関数(特にモデル
claude-4-sonnet用)を有効化します。ご利用のリージョンでモデルが利用できない場合にこれを有効化するには、クロスリージョン推論 をご参照ください。
Getting started with AI code conversion¶
移行検証プロジェクトを開始するには、次の手順を完了します。
Execute the code conversion of SnowConvert AI on your SQL Server database.
After the code conversion is complete, select GO TO AI code conversion from the Results page.

(i) AI の処理はすべて、自身が接続するSnowflakeアカウントで行われ、Snowflakeの料金が消費されます。
You will be redirected to the Connect to Snowflake page to enter the connection parameters of a testing account. This is necessary to ensure that the AI code conversion process creates objects and executes queries in the test database and avoids unintended changes to the production database. Select Continue.
Acknowledge and confirm the AI disclaimers and select Continue.
The Select objects page displays the current conversion status of each database object under the Conversion column. Select the required objects for AI code conversion. You can also run an AI code conversion process with source-system verification by selecting Upload custom instructions.

SnowConvert が自動的に次のアクションを実行します。
選択したオブジェクトに関連する従属オブジェクトを自動的に選択し、検証します。
選択したオブジェクトの概要、依存関係、推定時間、Snowflakeクレジットコストを精査します。
Confirms the selection to proceed with code conversion.
Select AI Convert. SnowConvert AI connects to your Snowflake account, where it relies on Cortex AI Functions to review your code and suggest resolutions to any problems. AI code conversion might take a few minutes to start, and it might run for several minutes or hours depending on the complexity of the code being verified.
The AI Results page shows the status for the AI code conversion of selected objects. The Status column indicates the AI code conversion outcomes. Select Details to review the test code and test results, source code, and converted code.

(i) デプロイする前に、AI によって生成されたコードを精査します。AI によって生成されたコードは正しく可能性があります。
Status of the AI code conversion:
Fixed with AI
Could not verify
確認済み
Error in original object
OPEN CODE:
By default, this option opens and compares your original source code and the code generated by the AI code conversion process in VS Code.
OPEN CODE の隣にある矢印をクリックすると、VS Codeで開いて比較するオプションもあります。
The converted code from SnowConvert and the code converted by AI.
Select VERIFIED BY USER for all objects for which you have accepted the AI code conversion. Only objects that are verified by the user can be deployed.
Billing and cost considerations with SnowConvert AI code conversion¶
AI code conversion consumes Snowflake credits based on the compute resources it uses in your Snowflake account. The following features contribute to the cost:
AI SQL - AI code conversion uses Cortex AI SQL.
ウェアハウス - テストクエリはウェアハウスで実行されます。
Snowflake stages - Input and outputs for AI code conversion are stored in a stage, which incurs storage costs.
SPCS - AI code conversion might consume a small amount of credits to use Snowpark Container Services. To find the costs associated with AI code conversion, look for compute pools with names that start with
AI_MIGRATOR. For more information, see Snowpark Container Services costs.
詳細については、 Snowflakeサービス利用表 をご参照ください。
Limitations of AI powered code conversion¶
The initial version is optimized for standard SQL Server migrations. While migration process can handle many query types, all the changes generated by SnowConvert AI code conversion must be reviewed by the customer before they can be deployed to any account.
AI 機能に関する法的通知¶
お客様によるSnowflake AI 機能の使用は、Snowflake AI & ML ドキュメント に記載されているものを含むがこれに限定されない、かかる使用に適用されるすべての契約、条件またはポリシーに従うものとします。