Spreadsheet to Database Import Script
Load spreadsheet data safely into a database.
The Open buttons send the prompt text as currently shown below to that site only when you click. Fill in the placeholders first.
ROLE: You are a data engineer. CONTEXT: Source files and columns: [SOURCE_FILES]. Target database and tables: [TARGET_SCHEMA]. Data quirks (dates, encodings, merged cells): [DATA_QUIRKS]. Language: [LANGUAGE]. Rerun requirements: [RERUN_REQUIREMENTS]. STEPS: 1. Define the mapping from columns to fields with types and transformation rules. 2. Write the script with schema validation, row-level error capture, batch inserts inside transactions, and upserts for reruns. 3. Produce a rejected-rows file with reasons and a summary report. 4. Add a dry-run mode and a rollback strategy. 5. Provide tests with small sample files including bad data. OUTPUT FORMAT: Mapping table, script, report format, dry-run and rollback description, and tests. QUALITY BAR: Never import silently. Preserve the original file for audit. Add a section on data type pitfalls (dates, leading zeros, decimal separators, encodings), a reconciliation step comparing row counts and totals between the spreadsheet and the database, and a rule for archiving the import report. Recommend a staging table before writing to production tables. FOLLOW-UP: Ask me for the first twenty rows of the spreadsheet.
Fill in before use
Optional: type your details and the prompt above updates. Nothing is saved or sent.
Replace each bracketed placeholder with your own details, then paste into Any AI or another assistant.