Hi all,

I am using SQLbulkCopy to transfer source data to multiple destination tables of SQL server 2005. I want to show the user - log file (text format) which data are transferred and which are not...how?
please suggest!

thanks
jeet

Recommended Answers

All 4 Replies

By what you are transferring??

I am using C# SqlBulkCopy class to transfer one table of SQL server into multiple tables of sql server

http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlbulkcopy.aspx

using (SqlBulkCopy bulkCopy =
                           new SqlBulkCopy(destinationConnection))
                {
                    bulkCopy.DestinationTableName =
                        "dbo.BulkCopyDemoMatchingColumns";

                    try
                    {
                        // Write from the source to the destination.
                        bulkCopy.WriteToServer(reader);
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.Message);
                    }
                    finally
                    {
                        // Close the SqlDataReader. The SqlBulkCopy
                        // object is automatically closed at the end
                        // of the using block.
                        reader.Close();

///LOG THE SUCCESS\ FAILURE OF THE OPERATION
                    }
                }

thanks,

i want exact data which are successfully copied to the table and not count. I want CSV file to be generated for which data is not transferred to the destination table


thanks,
jeet

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.