Convert SQL to DTA
Turn SQL files into DTA files. A Stata 14 file (format 118), which Stata 14 and later open.
Converted in an isolated sandbox on our serversDeleted after 24 hours
Drop SQL files on the dialor turn it to pick what to do
One Stata file for each table in your SQL script.Each table the script creates becomes its own DTA file, in Stata 14 format.
What you get
A Stata 14 file (format 118), which Stata 14 and later open. You get one file per table the script creates, named after the table and in name order.
A dump from MySQL, MariaDB or PostgreSQL is rewritten into SQLite's dialect first, then converted.
How values are typed
Integers and decimals become numbers. Columns declared DATE, DATETIME or TIMESTAMP become dates and date-times, shown as %td for dates and %tc for other times. Text columns stay text, even when they hold dates.
Whole numbers become byte, int or long variables where they fit. Text longer than 2,045 bytes becomes a strL. Binary values become escaped text, and NULL becomes missing.
What changes or is left out
Dates that are not real dates, such as MySQL's 0000-00-00, become missing. PostgreSQL true and false become 1 and 0.
Views, functions and triggers are left out with a warning. Only tables and their rows are converted.
Column names become Stata names of up to 32 letters, digits and underscores. When a name changes, the original is kept as the variable label. For other SQL conversions, see every SQL conversion.
SQL and DTA.What each format is.
The formats
SQL Script
SQL statements as text. A database dump that any SQL tool can read or replay.
- Extensions
- .sql
- MIME type
- application
/sql - Kind
- Text and data
Stata Data
Stata datasets.
- Extensions
- .dta
- MIME type
- application
/x -stata -dta - Kind
- Text and data
In your code.The same SQL to DTA conversion through the API, for your app or your agent.
$ cv convert report.sql report/ --to dta$ cv convert report.sql report/ --to dtaQuestions.What people ask about SQL to DTA.
One file per table the script creates, named after the table and in name order.
Yes. A dump from MySQL, MariaDB or PostgreSQL is rewritten into SQLite's dialect first.
Stata 14 and later. The file is Stata 14 format 118.
They become Stata names of up to 32 letters, digits and underscores. If a name changes, the original is kept as its variable label.