I have a stored procedure in sql that I am calling from vba in excel (using ADO). The stored procedure Inserts a record into the db table with 7 parameters.
The worksheet has 7 columns. There could be 100 or more rows at one time on the worksheet that I want to insert to the sql db using the Stored Procedure.
Can I loop through the rows of the worksheet and use the stored procedure to insert the values into the db table fields.
I was thinking to find last row of the worksheet with data, loop through the rows and execute the stored procedure.
Im not sure how to do this, and if it can be done with stored procedure? If it can be done does it insert as a batch of records or insert each row of the worksheet as a single insert?
Any guidance would be greatly appreciated.
The worksheet has 7 columns. There could be 100 or more rows at one time on the worksheet that I want to insert to the sql db using the Stored Procedure.
Can I loop through the rows of the worksheet and use the stored procedure to insert the values into the db table fields.
I was thinking to find last row of the worksheet with data, loop through the rows and execute the stored procedure.
Im not sure how to do this, and if it can be done with stored procedure? If it can be done does it insert as a batch of records or insert each row of the worksheet as a single insert?
Any guidance would be greatly appreciated.