Shows step-by-step SQL and tooling workflow to copy data, schema, and constraints from Google BigQuery to Microsoft SQL Server.
Export BigQuery tables to Cloud Storage, download as CSV or Parquet, then load files into SQL Server with BULK INSERT, bcp, or Azure Data Factory. Re-create schema, indexes, and constraints before loading.
Use EXPORT DATA with PARQUET to keep types. Example:EXPORT DATA OPTIONS(format='PARQUET', uri='gs://ecom_dump/customers_*.parquet') AS SELECT * FROM `shop.Customers`;
BULK INSERT and bcp are fastest.Example:BULK INSERT dbo.Customers FROM 'C:\ecom_dump\customers_000.parquet' WITH (DATA_SOURCE='ParquetSource', FORMAT='PARQUET');
Map STRING→NVARCHAR, INT64→BIGINT, NUMERIC→DECIMAL(38,9), TIMESTAMP→DATETIME2. Always check precision limits.
STRING <65535 → NVARCHAR(65535);
BOOL → BIT;
ARRAY → JSON or related table.
1. Script schema: bq show --schema --format=ddl shop.Customers > customers.sql
2. Adjust DDL to T-SQL, e.g., replace STRING
with NVARCHAR(255)
.
3. Run DDL in SQL Server.
4. Export data as PARQUET.
5. Register an external data source in SQL Server if using PolyBase.
6.Execute BULK INSERT for each table.
Disable constraints during load:ALTER TABLE Orders NOCHECK CONSTRAINT ALL;
Load data, then re-enable:ALTER TABLE Orders WITH CHECK CHECK CONSTRAINT ALL;
Split export files by 1 GB chunks, compress with gzip
, and load in parallel using multiple BULK INSERT sessions.
Compare counts:SELECT 'Customers' AS table, COUNT(*) FROM dbo.Customers UNION ALL SELECT 'Customers', (SELECT row_count FROM bigqueryinfo WHERE table_name='Customers');
Yes.Use Azure DevOps or GitHub Actions to run bq export, upload to Azure Blob, then kick off Data Factory pipelines that call stored procedures for BULK INSERT.
.
Yes. Create an external data source pointing to Azure Blob or S3, then use CREATE EXTERNAL TABLE ... WITH (DATA_SOURCE='ParquetSource')
and INSERT INTO
.
Schedule daily EXPORT DATA jobs filtered by timestamp and use MERGE in SQL Server to upsert.
No. bcp, BULK INSERT, or PolyBase handle most scenarios. Use SSIS when you need complex transformations or orchestration.