When copying the results of a view from a database on one server, to a another database on a new server (both running SQL Server 2008), which of the following methods is the likely to be the most efficient?
1. SSIS Dataflow task with OLE DB Source/Destination
2. Custom scripts
e.g.
using (SqlConnection connection = new SqlConnection(sourceConnectionString))
using (SqlCommand command = new SqlCommand(sourceQuery, connection))
{
connection.Open();
using (SqlDataReader reader = command.ExecuteReader())
{
using (SqlBulkCopy bulkCopy = new SqlBulkCopy(destinationConnectionString))
{
bulkCopy.DestinationTableName = destinationTable;
//Any Column mapping required
bulkCopy.WriteToServer(reader);
}
}
}
3. SSIS Bulk Insert
I don't see how this would be any different to using custom scripts, but without the added inflexibility that it only works with tables/views and not stored procedures.
I realise this is not quite like for like comparison because there are additional levels of logging and error handling etc available with the various options, but lets assume I require no logging at all to try and make the playing field as even as possible.