VBA uses stored procedures

Recently, a colleague put forward a requirement to export data according to the query conditions in the web project. It has already been done, but during the export process, the amount of data is relatively large, and the operation is relatively complex, so I wrote a stored procedure, which Contains temporary tables . Later, I felt that the efficiency was not very high, and I just knew a little excel VBA programming to directly access the database. Take the data out of the database and display it in excel! Just do what you say, but call the stored procedure, there is no response, there is no problem in sqlserver execution alone, and there is no problem in calling the web project! How is this going? Check it, first write only one query statement in the stored procedure, there is no problem; then write and insert into the temporary table, it will not be executed here, is there a problem with the temporary table, and finally found that before the statement inserted into the temporary table, add SET NOCOUNT ON , because when inserting data into a temporary table, it will generate information such as the number of rows, and SET NOCOUNT ON can block such information,

Thanks for the answer from kuangniaokuang in the thread http://club.excelhome.net/thread-1088823-1-1.html !

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327060206&siteId=291194637