SQL Server establishes Linked server cross-server database operations with C # in LINQPad

Source: Internet
Author: User
Tags management studio sql server management sql server management studio

When involved in the old project data migration, the database structure has changed completely, and the old data needs to be treated with special fields, and the data is large, using Navicat to export a single table, a table data about more than 1 million, the direct export of SQL execution simply does not work, executed to the general GG.

Then try using the LINQ pad to directly manipulate two databases for data migration, to search for it, to know that the LINQ pad supports multiple database operations and is also supported by linked SQL Server.

First, we open SQL Server Management Studio on the server for the new database, connect to the database, and then locate the linked server on the server object, and right-click the link server to select new linked server , such as:

Linked server: Fill in the Server IP address server type you want to associate: Select a different data source. Provider: Here because I was installing navicat for premium, so I chose his SQL provider directly. Data source: The IP address of the associated server is also populated here.

Then we came to security:

Choose to use this security context to establish a link, and then fill in your remote server's login username and password.

Then we open the LINQ pad, here I am using LINQ pad 5, create a new link, always next, then to this interface:

Select Include additional databases and the following screen will appear:

Choose your main database above, do not click Pick from list to select the database, will be prompted to find no linked server, here you manually click on an entry, in the server to fill in the server you just added IP, after the database to fill in the databases you want to attach to determine. Then, after the success, your connection will look like this:

Then you can do it directly in C #.

SQL Server establishes Linked server cross-server database operations with C # in LINQPad

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.