sql-server – SQL Server 2000 – 链接服务器

前端之家收集整理的这篇文章主要介绍了sql-server – SQL Server 2000 – 链接服务器前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
对于我们的应用程序,我们使用sql Server 2000& MysqL的.如果在sql Server 2000中进行任何修改,我想更新MysqL数据库.为此,我创建了MysqL链接服务器.它工作正常,但在触发器内它显示错误消息

[OLE/DB provider returned
message: [MysqL][ODBC 3.51
Driver]Optional feature not
supported]
Msg 7391,Level 16,
State 1,Procedure,
Line 6
The operation could not be performed because the OLE DB provider ‘MSDAsql’ was unable to begin a distributed transaction.”

这是我的触发器,

alter trigger upd_test_enum
on mtest
for insert
as
begin
   insert into emsdev...test_enum (id,name,is_active) values (4,'Test4',0)
end

请帮帮我.

看待,
穆巴拉克

解决方法

我必须做一些事情才能让它发挥作用.还使用Win2K sql服务器并从MysqL导入数据.

我们做的一件事是安装3.51.22版本的MysqL ODBC驱动程序(MysqL-connector-odbc-3.51.22-win32.msi).

然后下面的文章非常有用:http://www.sqlservercentral.com/Forums/Topic340912-146-1.aspx

主要是在创建链接服务器时关闭事务以及引用DSN.为便于参考,我将复制并粘贴以下帖子中sqlServerCentral文章中的说明:

Creating a Linked Server in SSMS for a MysqL database

  1. Download the MysqL ODBC driver from MysqL.com
  2. Install MysqL ODBC driver on Server where sql Server resides -Double Click Windows Installer file and follow directions.

  3. Create a DSN using the MysqL ODBC driver Start-> Settings -> Control Panel -> Administrative Tools -> Data Sources (ODBC) -Click
    on the System DSN tab -Click Add -Select the MysqL ODBC Driver
    -Click Finish On the Login Tab: -Type a descriptive name for your DSN. -Type the server name or IP Address into the Server text Box.
    -Type the username needed to connect to the MysqL database into the user text Box. -Type the password needed to connect to the MysqL
    database into the password text Box. -Select the database you’d like
    to start in. On the Advance Tab: Under Flags 1: -Check Don’t Optimize
    column width. -Check Return Matching Rows -Check Allow Big Results
    -Check Use Compressed protocol -Check BIGINT columns to INT -Check Safe Under Flags 2: -Check Don’t Prompt Upon Connect -Check Ignore #
    in Table Name Under Flags 3: -Check Return Table Names for
    sqlDescribeCol -Check Disable Transactions Now Test your DSN by
    Clicking the Test button

  4. Create a Linked Server in SSMS for the MysqL database SSMS (sql Server Management Stu@R_403_410@ -> Expand Server Objects -Right Click Linked
    Servers -> Select New Linked Server On the General Page: -Linked
    Server: Type the Name for your Linked Server -Server Type: Select
    Other Data Source -Provider: Select Microsoft OLE DB Provider for
    ODBC Drivers -Product name: Type MysqLDatabase -Data Source: Type
    the name of the DSN you created On The Security Page -Map a login to
    the Remote User and provide the Remote Users Password -Click Add
    under Local server login to remote server login mappings: -Select a
    Local Login From the drop down Box -Type the name of the Remote User
    -Type the password for the Remote User

  5. Change the Properties of the Provider MSDAsql Expand Providers -> Right Click MSDAsql -> Select Properties -Enable Nested queries
    -Enable Level zero only (this one’s the kicker) -Enable Allow inprocess -Enable Supports ‘Like’ operator

  6. Change settings in sql Server Surface Area Configuration for Features -Enable OPENROWSET and OPENDATASOURCE support.

  7. Change settings in sql Server Surface Area Configuration for Services and Connections -Enable Local and Remote connections via
    TCP/IP and named pipes

  8. Stop sql Server and sql Server Agent

  9. Start sql Server and sql Server Agent

我没有发现我需要重启sql服务器.

猜你在找的MsSQL相关文章