Download This document shows how to populate MS-SQL

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Data center wikipedia , lookup

Data model wikipedia , lookup

Expense and cost recovery system (ECRS) wikipedia , lookup

Data analysis wikipedia , lookup

Microsoft Access wikipedia , lookup

PL/SQL wikipedia , lookup

Concurrency control wikipedia , lookup

SQL wikipedia , lookup

Information privacy law wikipedia , lookup

Business intelligence wikipedia , lookup

Database wikipedia , lookup

Entity–attribute–value model wikipedia , lookup

SAP IQ wikipedia , lookup

Versant Object Database wikipedia , lookup

Open data in the United Kingdom wikipedia , lookup

Microsoft SQL Server wikipedia , lookup

Data vault modeling wikipedia , lookup

Relational model wikipedia , lookup

Clusterpoint wikipedia , lookup

Database model wikipedia , lookup

Transcript
This document shows how to populate MS-SQL Server Database from MS-Access
Database.We take the example of the Data we converted,
Problem statement ::
You have a MS-Access DB , say inventory.mdb, and SQL-Server DB, say mfg,
which have their relational schema almost same. Upgrade Data to mfg Database.
Here are the steps we followed :1)
Convert inventory.mdb to “inventory” DB in MS-SQL server using “import and export Data
wizard” ( The step by step procedure of using this wizard for data conversion will be explained. )
2) “mfg” can be populated table by table or several tables at once ( using the wizard, as will be
explained shortly )
3)
Right Click on “mfg” Database and choose “import Data .. “ from “All Tasks” option. “Import and
Export Data” dialog will open. Click Next.
4)
Next Dialog box shows the details needed to get from a Data Source. This Data Source can be
any Data ( OLE DB concept ) ranging from Microsoft Access Data to Text File. A list of Data
sources supported can be known from the Drop-down List Box control.
a)
i)
ii)
if you want to get data from Microsoft Access database then choose “Microsoft Access”
from the List Box control.
choose the mdb file ( datasource.mdb say ).
Type the username and password to connect to the Access Database.
b)
if you want to get data MS-SQL Server itself, then choose “Microsoft OLE Driver from
SQL Server” from the list box control and choose the Database Server which contains
the source Database ( “datasource” say ) in the list second list box control.
i)
choose the appropriate authentication mode ( NT Authentication or SQL Server
Authentication mechanism ) for connecting to the Database.
iii)
Choose the Database which you are connecting to, in “Database” list box control.
Click Next.
5)
Next Dialog box shows details for the Destination where data from Source needed to be copied.
This step is purely like previous step but you only have to fill up the details for the destination
database.
a) since we had to convert the data to MS-SQL Database. Our Destination Data Source was
“Microsoft OLE Driver from SQL Server” and other details can be filled in likewise.
6)
Next Dialog box shows the method adopted for Data Conversion. It can either be Tables and
views copy or Using a query to transfer to the Data. ( Third option was never used by us. )
a) Difference between the 2 options is that by choosing the “Tables and Views copy”
option, you cannot perform joins between different tables.
b)
Suppose “Tables and Views copy” option is choosen. Click next.
1)
2)
In the next dialog box, you can choose one or more tables or views to
copy. You can copy the data as it appears in the source or click (…) to
transform the data using ActiveX Script.
Click on the tables you want to copy , for each table you click on a
corresponding destination table will be shown by the wizard, look carefully
at the name of the table if you want to map the table to your own table
then select the table from the drop down list box control. Choose (…) to
map the individual fields in source table to fields in destination table.
Choose “<ignore field>” if you don’t want anything to done to that field.
Click next.
In the next dialog box, simply click next to run the wizard immediately,
there are other options like saving the package which we didn’t use.
Click next. See the summary provided by the wizard which you can
neglect as well. Click next and then finish, if copy is successful you will
be notified else it will show an error which you can diagnose.
c)
Suppose “Query to transfer data” is chosen. Click next.
1) Query text box will be there, you can write the query urself but you can also
use “Query Builder” by clicking on the “Query Builder” button ( which is what
we did and is as powerful and easy ).
2) If you choose Query Builder, choose the columns from the source database
to be copied.
Note :: Here , if you want a join of tables that can be done. Choose the fields
that should be selected from the tables and click next.
3) you can specify the sorting for the resulting tuples of the table. ( we didn’t
use it. ) click next.
4) Next dialog box specifies the “Where” Clause of an SQL Query, you can the
join condition over here and selection criteria. Click next.
5) You will get back to Pt. (1) where query text box is filled by the Query
Builder. Click next.
6) This dialog box is same as next Step when “copy tables and views” options is
chosen. Likewise, you can choose (…) to map the fields resulting from Query
to the destination fields. Click next.
7) Click next for the package to run immediately and click finish to run it. It
should do the job hopefully ;)
Points to take care of ::


While mapping the fields, check the datatype of source and destination field and nullability of
both. Incompatibility in that will generate error while running the the resulting package.
There are many options still in this wizard which we haven’t explored and we don’t think one
needs any other script to convert the data from any Data source to a SQL server database.
Amit and Prasad.