473,395 Members | 1,863 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,395 software developers and data experts.

Create Access Tables with a Pass Through Query from SQL2000 with SQL

jc
Hello, a question for the MS Access community, from someone who
programs with SQL in SQL2000. I currently create a table with varying
column names and data within SQL2000. I then need to reproduce the
same in a Access file DB.

The normal functions available with SQL2000 such as OpenRowSet are
good for Insert, Select etc., but not the simple "DDL" task of
creating a table.

Can another help/suggest ?

Regards JC.....

Mar 22 '07 #1
7 3492
On Mar 22, 7:16 am, "jc" <jc_user...@aanet.com.auwrote:
Hello, a question for the MS Access community, from someone who
programs with SQL in SQL2000. I currently create a table with varying
column names and data within SQL2000. I then need to reproduce the
same in a Access file DB.

The normal functions available with SQL2000 such as OpenRowSet are
good for Insert, Select etc., but not the simple "DDL" task of
creating a table.

Can another help/suggest ?

Regards JC.....
Have you investigated DTS to see if it will do what you need?

Mar 22 '07 #2
jc
>
Have you investigated DTS to see if it will do what you need?
Yes. DTS can generate SQL code (or it can be used) but it is no
flexible. It creates a DTS module but the Columns names become hard
coded within. Can it take parameters ? Not from what I have found.
Regards JC.......
Mar 22 '07 #3
"jc" <jc********@aanet.com.auwrote in news:1174562162.266662.142910
@l77g2000hsb.googlegroups.com:
Hello, a question for the MS Access community, from someone who
programs with SQL in SQL2000. I currently create a table with varying
column names and data within SQL2000. I then need to reproduce the
same in a Access file DB.

The normal functions available with SQL2000 such as OpenRowSet are
good for Insert, Select etc., but not the simple "DDL" task of
creating a table.

Can another help/suggest ?

Regards JC.....
Suggestions ...

I would try asking my MS-Sql management utility to script the SQL table
as CREATE. I would copy the T-SQL script and try running it in JET.
Would the syntax be compatible? I don't know. My guess is that it would
need minor revisions.

If I had some extra spare time to experiment I would try linking the
Access/JET db to the SQL server and see if I could modify the CREATE SQL
string to act on the linked server (actually the JET db). The SQL Server
Management Studio Utility provides a search and replace function for T-
SQL editing; I find this very powerful and it cuts down my work by maybe
90% when I want to duplicate SPROCS or VIEWS for tables or databases
other than those for which they were designed (of course, it reduces
syntax errors too).

You can, of course, set up an ADP connected to the SQL db/server and from
an MDB, simply import the sql tables. (The tables are SQL_Server in the
ADP, but Access converts them to JET in the MDB. Of course, this may not
be efficient for mega-tables.) The ADP can have other uses or, just be
there as a utility for you to import SQL tables. I have code somewhere to
do the import. I used to do this daily to back up my data from a remote
SQL db (because the provider of the SQL service charged $90.00 for each
backup). This procedure does not take a long time and can run silently,
invisibly and regularly if called from the Windows scheduler.
--
lyle fairfield

Ceterum censeo Redmond esse delendam.
Mar 22 '07 #4
lyle fairfield wrote:
If I had some extra spare time to experiment I would try linking the
Access/JET db to the SQL server and see if I could modify the CREATE SQL
string to act on the linked server (actually the JET db).
I know you can do this with Oracle. I don't know the specifics, but a
four or five years ago I had a developer working on an Access/Oracle app
who knew nothing whatsoever about Oracle DDL (and stupidly refused to
learn - how someone like that could call herself a developer when she
couldn't even create a table in the back end with which she was
working.... grrrr, down blood pressure, down, boy!). She somehow
mysteriously (to my mind) created tables using Access jet alone.
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Be Careful, Big Bird!" - Ditto "TIM-MAY!!" - Me
Mar 22 '07 #5
>She somehow mysteriously (to my mind) created tables using Access jet
>alone.
I suspect that she created the table in Access and then used

File Export...

with ODBC to create the Oracle table. That's clearly not the best way
because the data types can get "subtly altered". For example, Long
Integer columns in Access become VARCHAR2(20) in Oracle. But who
knows, maybe the application didn't need numbers anyway....

On Mar 22, 9:58 am, Tim Marshall
<TIM...@PurplePandaChasers.Moertheriumwrote:
lyle fairfield wrote:
If I had some extra spare time to experiment I would try linking the
Access/JET db to the SQL server and see if I could modify the CREATE SQL
string to act on the linked server (actually the JET db).

I know you can do this with Oracle. I don't know the specifics, but a
four or five years ago I had a developer working on an Access/Oracle app
who knew nothing whatsoever about Oracle DDL (and stupidly refused to
learn - how someone like that could call herself a developer when she
couldn't even create a table in the back end with which she was
working.... grrrr, down blood pressure, down, boy!). She somehow
mysteriously (to my mind) created tables using Access jet alone.
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Be Careful, Big Bird!" - Ditto "TIM-MAY!!" - Me

Mar 22 '07 #6
"jc" <jc********@aanet.com.auwrote
Hello, a question for the MS Access community,
from someone who programs with SQL in SQL2000.
I currently create a table with varying column names
and data within SQL2000. I then need to reproduce the
same in a Access file DB.

The normal functions available with SQL2000 such
as OpenRowSet are good for Insert, Select etc., but
not the simple "DDL" task of creating a table.

Can another help/suggest ?
Assuming you have or can obtain appropriate permissions, in an Access MDB,
link the SQL Server Table via ODBC, use a MakeTable Query (use the
QueryBuilder to create a SELECT query selecting all the fields you desire
from the SQL Server Table, then on the Menu: Query | Make Table).

Anyone who would write SQL or DDL from scratch when they could do the same
thing, simply, with point-and-click in the Query Builder is, IMNSHO, an "SQL
masochist". < :-) I include the smiley only because I have a number of SQL
masochists among my friends and try to avoid offending them overly much>.

Larry Linson
Microsoft Access MDB
Mar 22 '07 #7
Gord wrote:
>>She somehow mysteriously (to my mind) created tables using Access jet
alone.

I suspect that she created the table in Access and then used

File Export...
That sounds like it was probably it.

--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Be Careful, Big Bird!" - Ditto "TIM-MAY!!" - Me
Mar 22 '07 #8

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

Similar topics

3
by: dk | last post by:
Hi all, Would appreciate some advice on the following: I am trying to speed up an Access database connected to a SQL Server back-end. I know I can use a pass-through query to pass the sql...
1
by: annie | last post by:
Hi all, I have recently ported my Access 2000 app to SQL Server, keeping the Access client as the front end using linked tables. I am also using triggers on my SQL tables to trap orphan...
2
by: Galina | last post by:
Hello I need to get data from 4 Oracle tables and combine them into a temporary table in my application. I get data using a pass-through query dynamically created in code: mySQL = "SELECT...
8
by: Alfonso Esteban Gonzalez Sencion | last post by:
I am trying to use Access as a front end for extracting information from an Oracle database. I started using linked tables but I am getting a very curious behaviour. When I consult the linked...
4
by: Oceania | last post by:
Hi All, I did try using the sample code from the ADO.net forum to link one table, it is working fine. But, I got a problem when I tried to link all tables (20 tables)... Please help, thank...
8
by: Greg Strong | last post by:
Hello All, The short questions are 1 Do you know how to make DSN connection close in Access to Oracle 10g Express Edition? &/or 2 Do you know how to make a DSN-less pass-through query...
5
by: jonceramic | last post by:
Hi All, I started developing in Access, and people took notice and so we're starting to migrate into our corporate's bigger Oracle system. I'll still be using my developed Access front ends,...
4
by: etuncer | last post by:
Hello All, I have Access 2003, and am trying to build a database for my small company. I want to be able to create a word document based on the data entered through a form. the real question is...
6
by: jsacrey | last post by:
Hey everybody, got a secnario for ya that I need a bit of help with. Access 97 using linked tables from an SQL Server 2000 machine. I've created a simple query using two tables joined by one...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.