>Hi Gar & Dove,
>
>I need to explain a little more about the problem. I select records from one Table (SELECT * from OwnrAddr where somecondition...). The empty shell table contains all fields from all our tables (~200 fields). So, I'm afraid, I can not create an empty table from my Selected table.
Sure you can
For example:
SET DECIMALS TO 2
Select *, ;
SPACE(10) AS char10_field,;
VAL(str(0,6,2)) AS len6dec2_field,;
{} AS datefield,;
recno() as recnum
adds three new fields tot he result table that were not in source table -- including recording the recordnumber. (Note the record number trick only works if you are selecting from one table - if you are selecting from multiple tables you end up with garbage in the recnum field.)
(Note2: the syntax I gave you is for downloading from SQL server first, then adding the empty fields and recnum in the second select. However the ability to create fields by using expressions is fundamental to SQL and would actually work fine in query agains SQL server. There is no such thing as Recno() in SQL server, but if the table you are selecting from has an identity column, this may serve -- especially if you don't really need recno() and are just trying to get a unique id. If the table does not have an idenity column, you may be able to pursuade your dba to add one.)
Thanks
Gar W. Lipow