Hi paulizaz,
SQL Server provides the import/export tool to let us copy and transfer data easily. I recommend you to use it.
We can write our own class to do that, but I think it cannot as efficient and powerful as the tool SQL Server provided.
In my opinion, firstly we shall get the table schema from the table in old database and create the same or similar table in new database. Secondly we read the data from old table to a in memory DataTable object. At last, insert all the rows from DataTable to the table in new database.
Here are some links helpful for this scenario:
http://support.microsoft.com/kb/310107
http://msdn2.microsoft.com/en-us/library/fksx3b4f(VS.80).aspx
About how to insert all the data from DataTable to database table, here is a sample:
foreach (TableRow row in table.Rows)
{
command.CommandText = String.Format("INSERT INTO table VALUES ( {0},{1})", row[0], row[1]);
connection.Open();
command.ExecuteNonQuery();
connection.Close();
}
Sincerely,
Benson Yu
Microsoft Online Community Support
Please remember to click ?Mark as Answer? on the post that helps you, and to click ?Unmark as Answer? if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.