Data Conversion between SQL SERVER and ACCESS and EXCEL

Source: Internet
Author: User
Tags mdb database table name
Data Conversion between SQL SERVER and ACCESS and EXCEL
Database administrators familiar with SQL server 2000 know that DTS can import and export data. In fact, we can also use Transact-SQL statements to import and export data. In a Transact-SQL statement, we mainly use the OpenDataSource function and OPENROWSET function. For more information about functions, see SQL online help. SQL server, ACCESS, and EXCEL data conversion can be easily implemented using the following methods: 1. SQL SERVER and ACCESS data import and export conventional data import and export: use the DTS wizard to migrate your Access data to SQL Server. You can use these steps: 1. On the Tools menu of SQL SERVER Enterprise Manager, select Data Transformation 2 Services, and then select czdImport Data (import Data ). 3. In the Choose a Data Source dialog box, select Microsoft Access as the Source, and then type your. mdb Database (. mdb file extension) or browse to find the file. 4. In the Choose a Destination (select target) dialog box, select Microsoft ole db Prov ider for SQL Server, select database Server, and click the required authentication method. 5. In The Specify Table Copy or Query dialog box, click Copy tables ). 6. In the Select Source Tables dialog box, click Select All ). Next, complete. 1. query access data in SQL SERVER: -- ===================================================== =================== SELECT * FROM OpenDataSource (''Microsoft. jet. OLEDB.4.0 '', ''data Source =" c: DB. mdb "; User ID = Admin; Password = '')... table name limit 2. import access to SQL server -- ====================================== ============================== run in SQL SERVER: SELECT * INTO newtable from opendatasource (''Microsoft. jet. OLEDB.4.0 '', ''data Source =" c: DB. mdb "; User ID = Admin; Password = '')... table name limit 3. insert data in the SQL SERVER table to the Access table -- ============================ ====================================== run in SQL SERVER: insert into OpenDataSource (''Microsoft. jet. OLEDB.4.0 '', ''data Source =" c: DB. mdb "; User ID = Admin; Password = '')... table name (column name 1, column name 2) select column name 1, column name 2 from SQL table instance: insert into OPENROWSET (''Microsoft. jet. OLEDB.4.0 '', ''C: db. mdb ''; ''admin''; ''', Test) select id, name from Test insert into openrowset (''microsoft. jet. OLEDB.4.0 '', ''C: trade. mdb ''; ''admin''; ''', table name) SELECT * FROM sqltablename ---------------------------------------------------------
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.