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