🔥 V7.0 Released! DB2/MySQL migration, 13 new paths, and performance diagnosis.
Free Trial

SQLShift V3.0 Update: SQL Server Stored Procedure Conversion to GaussDB Is Now Supported

Jul 7, 2025

As a SQL dialect conversion tool for heterogeneous databases, SQLShift has gradually delivered Oracle stored procedure conversion to OceanBase and PostgreSQL over the past two months. Let’s look at the new capabilities in this release.

New Feature Highlights

✔️ SQL Server stored procedure -> GaussDB function refactoring: supports intelligent T-SQL -> PL/pgSQL conversion with structural and semantic adaptation.

✔️ Batch conversion capability: convert dozens to hundreds of stored procedures at once, with automatic syntax risk detection.

Feature Details

1. Intelligent Conversion from SQL Server Stored Procedures to GaussDB

The biggest highlight of this release is accurate semantic mapping and syntax refactoring for complex differences between SQL Server and GaussDB.

🔍 Multi-dimensional Syntax Compatibility Assessment

SQLShift evaluates compatibility in GaussDB for syntax elements used in SQL Server stored procedures, including structure definitions, system views, and data types. It covers 300+ syntax points for precise cross-database mapping. Examples include:

  1. Structure definitions: SQL Server CREATE PROCEDURE is rewritten as CREATE FUNCTION ... RETURNS type LANGUAGE plpgsql to satisfy GaussDB constraints.
  2. System functions: SQL Server @@spid is rewritten to pg_backend_pid() in GaussDB.
  3. System views and tables: SQL Server sys.columns is mapped to information_schema.columns.
  4. Temporary objects: SQL Server SELECT ... INTO #temp_table is rewritten as CREATE TEMP TABLE ... AS.
  5. Data types: SQL Server DATETIME is rewritten as TIMESTAMP(3).
  6. Keywords: for patterns like CREATE TABLE DemoTable(CONTENT BIT, DBTIMEZONE VARCHAR(50)..., SQLShift automatically renames GaussDB reserved words (such as DBTIMEZONE) and provides recommendations for business-sensitive identifiers (such as content).
  7. More syntax conversions are available for exploration.

🔍 Intelligent Conversion of Non-standard Syntax

SQLShift performs semantic-level fixes for SQL Server-specific non-standard patterns and platform behavior differences, achieving both “recognition” and “reconstruction.” Typical examples:

  1. Early alias reference in UPDATE
    • SQL Server syntax: UPDATE a SET col=1 FROM tableA a WHERE a.id=b.id
    • GaussDB syntax: UPDATE tableA a SET col=1 FROM tableB b WHERE a.id=b.id
      • Rationale: GaussDB requires explicit primary-table alias scope in UPDATE.
  2. Statements without terminators
    • SQL Server syntax: SELECT * FROM table
    • GaussDB syntax: SELECT * FROM table; (semicolon auto-completed) More SQL Server-specific conversion cases are available in product experience.

🔍 GaussDB-specific Mapping and Semantic Refactoring

General models are often trained on generalized PostgreSQL syntax and may fail to identify version-level differences between GaussDB and PostgreSQL, causing high-risk mis-conversions. For example, GaussDB V2.0-3.x does not support some PostgreSQL functions like uuid_generate_v4() and only supports ON COMMIT {PRESERVE ROWS | DELETE ROWS}. Without version knowledge, generic models may still apply PostgreSQL rules.
SQLShift deeply understands GaussDB version differences, integrates official Huawei syntax rules, and combines semantic recognition with behavior refactoring. It dynamically parses the precise target cluster version to ensure each conversion is usable, controllable, and maintainable:

  • Business logic refactoring: NEWID() -> business unique identifier reconstruction (for example Java UUID.randomUUID().toString()), avoiding missing-equivalent-function risks.
  • Temporary table behavior refactoring: ON COMMIT DROP -> explicit cleanup chain (ON COMMIT DELETE ROWS + DROP) to ensure compliant lifecycle handling and prevent temp-table buildup that could trigger OOM.

2. Batch Stored Procedure Conversion, Doubled Efficiency

Still converting procedures one by one? SQLShift batch processing can handle migration of hundreds of procedures with ease:

✅ Script upload: supports SQL files containing multiple stored procedures
✅ Intelligent splitting: precisely identifies boundaries and auto-assigns conversion tasks
✅ Progress tracking: real-time visual status with intelligent anomaly prompts
✅ Syntax compatibility assessment: identifies incompatibilities and refactors automatically
✅ Unified export: exports target-compatible stored procedure files
Batch conversion

Next Preview

📌 Support for complex stored procedures exceeding 400 lines
📌 SQL Server -> OceanBase stored procedure conversion


🎁 Limited-time Offer

The first 100 users can click here or follow the steps below to claim 30-day stored procedure conversion credits.

1. Click “Free Trial” in the top-right corner, then register and sign in to SQLShift.

Login

2. After signing in, click “Claim Credits” at the lower-left.

  • Enter redemption code: 83103ce2-9167-439c-a03c-532c911fb516
  • Successfully claim 10 credits, valid for 30 days. Login