How SQL Server accesses the tables of the Sybase database

Source: Internet
Author: User
Tags dsn odbc ole sybase sybase client sybase database table name

One install Sybase client

Version: Sybase Client 11.9.2 for NT

1 after the installation completes, the operation starts-> program->sybase->dsedit

2 Select Menu ' Server Object ',-> ' Add ' to enter service name like 1.70

3 then select ' 1.70 ' in the server list, double-click the dialog box on the right, and select Add in the Network Address dialog box, for example 132.228.1.70,4300,ok OK

4 Select the Ping Server button on the toolbar to test whether the server can be connected (red lightning-like button)

Second, create DSN in ODBC

Administrative Tools-> Data source ODBC

Create a new System DSN with the name set to 1.70

In the Create New Data Source dialog box, select the ' Sybase System11 ' data source driver,

DSN Datasouce name for the General property: fill in 1.70,

Database: Fill in Sybase database name

OK save

Third, establish a linked server

Enterprise Manager-> Security-> build linked server-> new linked server

1) in the regular label column

Name Sybase,

Server type Choose a different data source, select Microsoft OLE DB Provider for ODBC in the name of the provider,

Data source: Fill in the DSN name 1.70

2) Security column

Local Login Fill SA

Remote users and remote passwords fill in Sybase username and password

3 Use this security context to establish a connection

Remote Login Enter Sybase username and password

Enter a password with a password

OK save

Four use SA identity Login Query Analyzer

You can detect Sybase data by executing the following SQL statement

SELECT * from Linked server name (this example is Sybase). Sybase's database name. dbo.sybase's Table name

Note: If you find this problem when you execute a query: the OLE DB provider "MSDASQL" of the linked server "Sybase" provides inconsistent metadata for the column.

Solution:: Do not directly with the SELECT * from Sybase.dbname.dbo.tablename this statement, change the statement, you can solve the problem. The statements are as follows: SELECT * FROM OPENQUERY (Sybase, ' select * from Dbname.dbo.tablename ')

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.