
Importing Excel Data Into SQL Server With OPENROWSET
Query an Excel file straight from T-SQL with OPENROWSET and the ACE provider, enable ad hoc distributed queries safely, and load into a staging table.
Everything you need to level up your coding skills.

Query an Excel file straight from T-SQL with OPENROWSET and the ACE provider, enable ad hoc distributed queries safely, and load into a staging table.

Find a file's delimiter in four steps, from looking at the bytes to a quote aware check, and see where Python, DuckDB and qsv sniffers disagree.

Fix PCDATA invalid Char value and reference to invalid character number: which characters XML 1.0 forbids, how to strip them from 28 MB in 0.03 s and verify.

Set up PostgreSQL for development: choose native or Docker, pick a version, create a user, connect, find the config files and fix common errors.

Use the SQL Server Import and Export Wizard to load an Excel sheet, fix the ACE provider and 64-bit errors, and stop it from guessing column types wrongly.

A CSV has no flag that says whether row one is a header, so readers guess. Test four files, set the header explicitly, and handle duplicate names.

Unexpected end of JSON input means the text stopped too soon or was empty. Real messages for every cut point, and how to tell truncated from empty.

SQLite cannot read XLSX itself. Load a sheet through pandas to_sql or a CSV import, avoid type affinity traps and convert Excel serial dates.

A CSV from Windows leaves an invisible carriage return on every last column. See it in a shell loop and MySQL, and fix it without damaging quoted fields.

Why XML fails with Premature end of data in tag: truncated downloads, cut gzip streams and empty responses, how each message differs, and what to check.

Why the country code NO becomes False in YAML 1.1, how keys collide, which parsers are affected and three fixes: quote, use a 1.2 parser or a schema.

See how a stray comma turns one column into two, what the four quoting states are, and why a backslash does not escape a quote in CSV the way it does in code.
We send one email when a new article is published. No spam.