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

  • Beschleunigte AI-Validierung: Reduzieren Sie erheblich die Zeit und Ressourcen, die Sie für manuelles Testen aufwenden.

  • Automatisiertes Testen: Der Agent generiert automatisch Testfälle auf Basis Ihrer bestehenden Abfragen und Geschäftslogik.

  • Vorgeschlagene Agenten für die Reparatur: Der Agent schlägt Korrekturen für Ihren bestehenden Code vor, um konsistente Ergebnisse zwischen Ihrem Altsystem und Snowflake sicherzustellen.

Prerequisites for AI code conversion

Before you get started with AI code conversion, complete the following steps:

  1. Laden Sie SnowConvert AI herunter und installieren Sie es.

  2. [Empfehlung] Konvertieren Sie Ihren alten SQL Server-Code mit SnowConvert AI.

  3. Verwenden Sie ein speziell für Tests und Entwicklung vorgesehenes Konto und vermeiden Sie die Nutzung eines Produktionskontos.

    Some objects will be created as part of the AI code conversion process.

  4. Stellen Sie sicher, dass die Rolle PUBLIC im verbundenen Konto keinen Zugriff auf Produktionsdaten hat und keine Berechtigungen zum Ausführen sensibler Vorgänge wie CREATE- oder USER-Befehle besitzt.

  5. Ensure that the role used for AI code conversion has the following privileges on the account:

    • CREATE DATABASE

    • CREATE-MIGRATION

  6. Aktivieren Sie die Cortex AI SQL-Funktionen im Konto, speziell für das Modell claude-4-sonett.

    • Um das Modell zu aktivieren, falls es in Ihrer Region nicht verfügbar ist, siehe [Cross-region inference] (https://docs.snowflake.com/en/user-guide/snowflake-cortex/cross-region-inference#any-region).

Getting started with AI code conversion

Um ein Validierungsprojekt für die Migration zu beginnen, führen Sie die folgenden Schritte aus:

  1. Execute the code conversion of SnowConvert AI on your SQL Server database.

  2. After the code conversion is complete, select GO TO AI code conversion from the Results page.

    (i) Die gesamte AI-Verarbeitungslogik findet in dem Snowflake-Konto statt, mit dem Sie sich verbinden. Dort werden auch die Snowflake-Nutzungskosten verursacht.

  3. 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.

  4. Acknowledge and confirm the AI disclaimers and select Continue.

  5. 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 führt automatisch die folgenden Aktionen aus:

    1. Führt automatisch abhängige Objekte aus und validiert sie, wenn sie mit den von Ihnen ausgewählten Objekten verbunden sind.

    2. Gibt eine Zusammenfassung der ausgewählten Objekte, ihrer Abhängigkeiten sowie der geschätzten Kosten für Zeit und Snowflake-Credits zurück.

    3. Confirms the selection to proceed with code conversion.

  6. 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.

  7. 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) Überprüfen Sie den von AI generierten Code, bevor Sie ihn bereitstellen. Von AI generierter Code ist möglicherweise nicht korrekt.

    • Status of the AI code conversion:

      • Problem mit AI behoben

      • Konnte nicht verifiziert werden.

      • Verifiziert

      • Fehler im ursprünglichen Objekt

    • 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.

      • Wenn Sie auf den Pfeil neben OPEN CODE klicken, haben Sie auch die Möglichkeit, einen Vergleich in VS-Code auszuführen:

        • The converted code from SnowConvert and the code converted by AI.

  8. 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.

  • Warehouse - Testabfragen werden in einem Warehouse ausgeführt.

  • 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.

Weitere Informationen finden Sie in der Snowflake Service Consumption Table.

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.