473,416 Members | 1,547 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,416 software developers and data experts.

Table structure and data transfer from SQL2000 to Access (.mdb)

jc
Hello. I want to ask about the possibility of copying both a table
structure and it's contents from a
SQL server table to a table within MS access. The problem cannot be
solve with a permanent table structure at the target location.
The names of the columns are essentially data with the application and
so are subject to change. I am targeting a solution using SQL Query
Manager.

The approach I have tried (with failure) is
SELECT *
INTO <linkedserver table>
FROM <local table>

This should create and copy. However, I am not sure if this is
achievable with this approach.

Refer to the dialogue;
-------------------------------------------------------
USE MASTER
GO
EXEC sp_addlinkedserver
@SERVER = 'Freddie',
@PROVIDER = 'Microsoft.Jet.OLEDB.4.0',
@SRVPRODUCT = 'OLE DB Provider for Jet',
@DATASRC = 'C:\temp\HMIS_Recipe.mdb'

-- I am not sure if this is required
EXEC sp_addlinkedsrvlogin 'Freddie', false, 'sa', 'Admin', NULL

SELECT * FROM Freddie...FRED -- This is OK

SELECT * INTO #Temp FROM Freddie...FRED -- This is OK

-- This fails - Refer error
SELECT * INTO Freddie.FRED65
from #temp

Server: Msg 2760, Level 16, State 1, Line 1
Specified owner name 'Freddie' either does not exist or you do not have
permission to use it.

-- This also fails and I thought reflected the above select with naming
- Refer error
SELECT * INTO Freddie...FRED65
from #temp

Server: Msg 117, Level 15, State 1, Line 2
The object name 'Freddie...' contains more than the maximum number of
prefixes. The maximum is 2.

EXEC sp_dropserver 'Freddie',
@droplogins = 'droplogins'

------------------------------------------------------------

Thank you.

Regards JC...

Aug 7 '06 #1
3 2474
jc (jc********@aanet.com.au) writes:
Hello. I want to ask about the possibility of copying both a table
structure and it's contents from a
SQL server table to a table within MS access. The problem cannot be
solve with a permanent table structure at the target location.
The names of the columns are essentially data with the application and
so are subject to change. I am targeting a solution using SQL Query
Manager.

The approach I have tried (with failure) is
SELECT *
INTO <linkedserver table>
FROM <local table>

This should create and copy. However, I am not sure if this is
achievable with this approach.
While this will copy some of the table properties, it will not carry
over indexes etc. So I don't think that this is a good start. You
should probably get script with CREATE TABLE statemnets that also
include definitions of constraints, keys indexes etc. Bare in mind that
Access and SQL Server are quite different, so you may have to do changes
along the way.

--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Aug 8 '06 #2
jc

Hi.
My basic problem with the initial posting is that I can read tables
from the linked server (the Access .mdb) but cannot create a table with
the "SELECT * INTO table" statement.

Regards JC....

Aug 9 '06 #3
jc (jc********@aanet.com.au) writes:
My basic problem with the initial posting is that I can read tables
from the linked server (the Access .mdb) but cannot create a table with
the "SELECT * INTO table" statement.
Yeah, the point with my post is that even if you could it would only take
you half-way, so I don't think is a viable route.

But I see now that I misread your message (was tired last night). I figured
you wanted to copy tables from Access to SQL Server when you in fact want
to do it in the opposite direction. And I'm afraid that's an even deader
end. How would SQL Server be able to create tables on an entirely different
engine? The linked server may even be a non-relational data source.

You may want to look at the Import/Export wizards. I have never used them
myself, though.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Aug 9 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Robert Morgan | last post by:
------=_NextPart_000_0009_01C3535E.C763E5F0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, I'm doing a project for a local hospital, they want to...
0
by: QWERTY | last post by:
--------------Boundary-00=_O5I3QL80000000000000 Content-Type: Multipart/Alternative; boundary="------------Boundary-00=_O5I3LVC0000000000000" --------------Boundary-00=_O5I3LVC0000000000000...
0
by: hai99 | last post by:
hello, i create a new datatable by code and want to store this table in an access-mdb. there is a lot stuff about to select data from an access-mdb and pass the result to a datatable. but i...
1
by: DataB | last post by:
Hi Everyone! I have, essentially, two table structures in the same ms access database file. Both are of the parent-child format, one parent table with personal details, then multiple child...
2
by: tekanet | last post by:
Hello folks, I'm developing a program that reads an access MDB file and produce some scripts to rebuild the same structure against other databases (MSSQL, MySQL and so on). Reading structure...
2
by: Andy Davis | last post by:
Has anybody tried and had any success exporting data directly from ACT! 2000 to an Access database? I need to transfer data from ACT! to Access, but the data is all imported as text, including date...
0
by: Vikram Attiganal | last post by:
Hi, I need to know the table structure of an MS-Access database. I tried Desc table sql and it doesnt seem to work. Is there any other method to know the structure of a table. I need to know it from...
3
by: genojoe | last post by:
I have tried everything I can think of to move records from one Access database to another. It should not be that hard. Read on.... I have identical access mdb's. One contains data; one...
6
by: okan | last post by:
Hi everyone. My question is that i have a form which includes subform,too. in this form for example i choose a country and in the subform its capital, currency,president are shown. and i have a...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.