Q: How does SQL server access the table of the sybase database?
A: The specific method is as follows:
1: Install the Sybase Client
Version requirements:
Sybase client 11.9.2 for NT
1.1: After the installation is complete, start running->Program-> Sybase-> dsedit
1.2: Select 'server object' in the menu,-> 'add', and enter the service name, for example, 1.70.
1.3: Select '1. 70' in the server list, double-click the server address column in the right-side dialog box, and select Add in the network address attribute dialog box to fill in the IP address, such as 132.228.1.70, 4300, OK
1.4: select the ping server button in the toolbar to test whether the server can be connected (the red button similar to lightning)
2: Create a DSN in ODBC>
Management tools-> data source ODBC
Create a system DSN named 1.70.
In the create a data source dialog box, select the 'sybase system11' data source driver,
DSN datasouce name of the general attribute: Enter 1.70,
Database: Enter the Sybase Database Name.
Are you sure you want to save
3: Create a linked server
Enterprise Manager-> Security-> link server-> new link Server
3.1: Regular tab Section
Name Sybase,
Select another data source for the server type and select from the provider name
Microsoft ole db provider for ODBC
Data source: Enter DSN name 1.70
3.2: Security Section
Enter SA for local Login
Enter the user name and password of Sybase for the remote user and remote password.
3.3: use this security context to establish a connection
Enter the user name and password of Sybase during Remote logon.
Enter the password
Are you sure you want to save
4: log on to the query analyzer as a SA
Run the following SQL statement to check Sybase data.
Select * From link server name (Sybase in this example). Sybase Database Name. DBO. Sybase table name
Note: if this problem is found during query execution: The ole db access interface "msdasql" of the linked server "sybase" provides inconsistent metadata for columns.
Solution: do not directly use the following statements:
Select * from Sybase. dbname. DBO. tablename
You only need to change the statement to solve the problem. The statement is as follows:
Select * From openquery (Sybase, 'select * From dbname. DBO. tablename ')