A robust T-SQL utility designed to extract, transform, and migrate complex, nested JSON product data into structured relational SQL tables. This project demonstrates advanced SQL techniques for handling modern data formats in enterprise environments.
sql/: Contains the core migration script (migration_script.sql).data/: Contains the standardized sample dataset (sample_product.json).
- Automated Parsing: Extracts deep-nested objects (Variants, Specs, Brands) using
OPENJSONandCROSS APPLY. - Dual Mode Support: Capability to load data from physical files or internal staging tables.
- Data Integrity: Implements robust error handling with
TRY...CATCHblocks. - Clean Schema: Migrates data into normalized tables (Products, Categories, Variants, Attributes).
- Clone the repository.
- Open
sql/migration_script.sqlin SQL Server Management Studio (SSMS). - Update the
@JSONFilePathvariable to match the location ofdata/sample_product.jsonon your machine. - Execute the script to see the transformation in action.
Ein robustes T-SQL-Utility zum Extrahieren, Transformieren und Migrieren komplexer, verschachtelter JSON-Produktdaten in strukturierte relationale SQL-Tabellen. Dieses Projekt demonstriert fortgeschrittene SQL-Techniken zur Handhabung moderner Datenformate in Unternehmensumgebungen.
sql/: Enthält das Haupt-Migrationsskript (migration_script.sql).data/: Enthält den standardisierten Beispieldatensatz (sample_product.json).
- Automatisches Parsing: Extrahiert tief verschachtelte Objekte (Varianten, Spezifikationen, Marken) mittels
OPENJSONundCROSS APPLY. - Duale Modus-Unterstützung: Lädt Daten entweder aus physischen Dateien oder aus internen Staging-Tabellen.
- Datenintegrität: Implementiert robuste Fehlerbehandlung durch
TRY...CATCH-Blöcke. - Sauberes Schema: Migriert Daten in normalisierte Tabellen (Produkte, Kategorien, Varianten, Attribute).
- Klonen Sie das Repository.
- Öffnen Sie
sql/migration_script.sqlim SQL Server Management Studio (SSMS). - Passen Sie die Variable
@JSONFilePathan den Speicherort vondata/sample_product.jsonauf Ihrem Rechner an. - Führen Sie das Skript aus, um die Datentransformation zu starten.