Vignesh M
Vignesh M

Reputation: 178

Select into VS Import and export wizard in sql server

In sql server, From my desktop I connected to the server. And I want to move a data from a database to another. I have used both select into and import wizard. But import wizard seems to be slow. Why?

Is there any methodology changes for transferring data ?

Upvotes: 0

Views: 3373

Answers (3)

Daljeet Singh
Daljeet Singh

Reputation: 714

Mysql Store data into many places and it stores data in Small chunk of files for faster retrieve and when we use export wizard what it does is write all metadata and data to our RAM first and depending on our system and increases overhead and same happen in case of importing, and Select into is fast because mysql has to create inbuilt replica of the database that already exist.

in real life, Select into is like photocopy of a page whereas wizard is like re-writing the page manually.

Upvotes: 0

Andrey Davydenko
Andrey Davydenko

Reputation: 350

Select into is a SQL query, and it is executed directly.
Import and Export Wizard is a tool which invokes Integration Services (SSIS).
Wizard is slow, but can use various data sources

More about export/import wizard
https://msdn.microsoft.com/en-US/en-en/library/ms141209.aspx
Topic about select into and export/import wizard
https://social.msdn.microsoft.com/forums/sqlserver/en-US/e0524b2a-0ea4-43e7-b74a-e9c7302e34e0/super-slow-performance-while-using-import-export-wizard

Upvotes: 1

WorkSmarter
WorkSmarter

Reputation: 3808

I agree with Andrey. The Wizard is super slow. If you perform a Google search on "sql server import and export wizard slow", you will receive nearly 50k hits. You may want to consider a couple of other options.

BCP Utility

Note: I have used this on a number occasions. Very fast processing.

The bcp utility bulk copies data between an instance of Microsoft SQL Server and a data file in a user-specified format. The bcp utility can be used to import large numbers of new rows into SQL Server tables or to export data out of tables into data files. Except when used with the queryout option, the utility requires no knowledge of Transact-SQL. To import data into a table, you must either use a format file created for that table or understand the structure of the table and the types of data that are valid for its columns.

Example:

BULK INSERT TestServer.dbo.EmployeeAddresses
FROM 'D:\Users\Addresses.txt';
GO 

OPENROWSET(BULK) Function

The OPENROWSET(BULK) function connects to an OLE DB data source to restore data and it allows access to a remote data by connecting to a remote data source.

Example:

INSERT INTO AllAddress(Address)
SELECT * FROM OPENROWSET( 
   BULK 'D:\Users\Addresses.txt', 
   SINGLE_BLOB) AS x;

Reference

https://msdn.microsoft.com/en-us/library/ms175915.aspx

http://solutioncenter.apexsql.com/sql-server-bulk-copy-and-bulk-import-and-export-techniques/

Upvotes: 0

Related Questions