Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: ODBC import

From   Janet Hill <>
To   "" <>
Subject   st: ODBC import
Date   Fri, 13 Dec 2013 16:57:16 +0000 (GMT)

I need to import some large tables from Access 2013 to Stata 13.1 and I have been using the following command:
odbc load,exec(`"SELECT Demographics.*, Visit.* FROM Demographics INNER JOIN Visit ON Demographics.Hospid = Visit.HosPid"')///
lower allstring connectionstring(`"Driver=Microsoft Access Driver (*.mdb, *.accdb);DBQ=C:\Students\September.accdb"')

This fails with the error:
hospid already defined

and this occurs because Stata does not prefix the column name with the table name. I can explicitly add each table.column, which works on a small dataset,but because there are 15 columns in one table and 30 in the other this becomes unwieldy and prone to typing errors. Other tables may be larger.

I would be grateful for any suggestions on how to solve this problem.

Many thanks,

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index