sql server - storing/creating local table from linked SQL table -


i have linked table in access database (dbo_billing_denied (dsn=wtstsql05_bb;database=deptfinance), etc.) , want create table store data linked local table, can use run other queries. can use because tells me can not make connection (odb--connection 'wtstsql05_bb' failed.

do have create table first , assign fields before can (create table , fields same what's in linked table , create append query this...)?

thanks!

it sounds might have 2 problems. address second one. need reestablish connection linked table before work.

you can use "make table query" in access make local copy of linked table. can use gui this, or can structure sql this:

select <list of various fields, or * fields> <name of new local table> <name of linked table(s) on server> <any other conditions want put on records included>;

i mentioned there might more 1 table. can joined tables or unions etc. "where" clause optional. removing copy entire data set.

you warning when try execute query in access. tell you write (or overwrite) table. if trying write cleaner application fewer nuisance messages end user, call query macro. macro need turn warnings off, execute query, turn warnings on.

microsoft access not require create table before write it; if table not exist access create table you, based on field definitions in source data. if table of same name exist, access drop table database , create new table of name.

this implies local table generating need unique name. if query tries overwrite linked table using same name, first thing access drop linked table. field definitions , input data in linked table dropped.

since new local table have new name, queries developed linked table not work new local table. 1 possible work-around rename linked table in local access database. table name in access not need equal name in database it's linking to. query write table correct name, , previous queries should work. still, keep in mind these queries no longer working on live data.


Comments