Pages

2018年9月17日 星期一

Suppress Power Query's Native Database Query Warning at Excel


Go to "Query Options"


 Uncheck "Require user approval for new database queries" at Security and OK to save

2018年8月24日 星期五

Create Link Server for MySQL at MSSQL


  1. Download and install “Visual C++ Redistributable for Visual Studio 2015”
    https://www.microsoft.com/en-us/download/details.aspx?id=48145
  2. Download and install “Connector/ODBC”
    https://dev.mysql.com/downloads/connector/odbc/
  3. After install finished, MySQL ODBC Driver will list at "ODBC Data Source Administrator"
  4. Setup "System DNS" at "ODBC Data Source Administrator".
    Click "Add" button.

    Select "MySQL ODBC 8.0 ANSI Driver

    Fill in connection info
  5.  Create link server at Microsoft SQL Management Studio
    • General
      Provider: Microsoft OLE DB Provider for ODBC
      Product: MySQL
      Data source: same as "System DNS"
    • Security
      Be made using the security context
  6. Test script
    • SELECT * from OPENQUERY (Linked_Server, 'select * from test.table'); 
    • INSERT OPENQUERY (Linked_Server, 'select name,address from test.table') VALUES ('Jason','Malaysia'); 
    • UPDATE OPENQUERY (Linked_Server, 'select name from test.table WHERE user_id = 0001') SET name = 'Tom'; 
    • DELETE OPENQUERY (Linked_Server, 'select name from test.table WHERE user_id = 0002');
 
 
Blogger Templates