Bookmark and Share   st: Re: odbc load from SQL if ID is in my
Stata master dataset?  From   "Joseph Coveney" <> To   <> Date 
Tue, 18 Sep 2012 21:35:53 +0900  Jen Zhen wrote:  I have a list
of person ID numbers for whom I would like to merge in
information from a large SQL dataset (containing the IDs in the
first list, plus many more).  I assume that I cannot directly
merge in from the SQL dataset, but must first load the SQL
dataset into Stata, save as dta, and then I can merge that into
my main dataset.  However, I'm wondering how, when loading from
SQL with --odbc load-- I can best specify that I'm only
interested in observations with a fixed list of ID numbers?
What would work is to write "WHERE id=51 OR id=332 OR ...", but
since I have several hundred valid IDs this seems inefficient.
Would anyone happen to know a better way?   Have you considered
creating a temporary table in the database, uploading the Stata
dataset of IDs into it (using -odbc insert-), and finally -odbc
load, exec()- where the exe