tags:

views:

13

answers:

1

Can SqlBulkCopy create a table, kind of like a SELECT INTO?

A: 

It seems that SqlBulkCopy can not create tables by itself. The destination table has to be predefined. In the case where the destination has got an auto incremental identity (int), just use a 1 in the select statement i.e.

SELECT 
    1, 
    [ColumnName],
    [ColumnName]...
FROM TABLENAME

Sql Server will handle the auto incrimination by itself.

BK