Can anyone tell me the following 2 ways of inserting record creates better performance?
Case 1
SqlCommand cmd = new SqlCommand();
f
I don't think the second one will work.
There is however a syntax in SQL Server 2008 for inserting multiple rows in a single INSERT statement and I think that will be faster than both the options you proposed:
INSERT INTO test (id, name)
VALUES
('1', 'foo'),
('2', 'bar'),
('3', 'baz')
-- etc...
However if you really want high performance, consider using the SqlBulkCopy class.