简体   繁体   English

将数据从 Excel 导出到 SQL 服务器 - VBA

[英]Exporting Data from Excel to SQL Server - VBA

I know I can loop through the worksheet and add, row by row, data into SQL Server.我知道我可以遍历工作表并将数据逐行添加到 SQL 服务器中。

But I always wondered how dangerous could it be.但我一直想知道这会有多危险。 Will I make the database (or even the server) slower?我会让数据库(甚至服务器)变慢吗? What are the impacts?有什么影响?

I also know that there are other methods, I just want to understand the limits of this specific one.我也知道还有其他方法,我只是想了解一下这个具体的限制。

Thanks in advance.提前致谢。

PS: I'm talking about huge (thinking about the 1,4M rows of Excel limits) files 500k-800k rows and several columns. PS:我说的是巨大的(考虑 Excel 限制的 1,4M 行)文件 500k-800k 行和几列。

But I always wondered how dangerous could it be.但我一直想知道这会有多危险。 Will I make the database (or even the server) slower?我会让数据库(甚至服务器)变慢吗? What are the impacts?有什么影响?

  • Any operation that you do in database will use the database resources and it will have some impact on the performance of the database.您在数据库中所做的任何操作都会占用数据库资源,并且会对数据库的性能产生一定的影响。 Sometimes the operation is so small or simple that the overall impact is negligible.有时操作是如此的小或简单,以至于整体影响可以忽略不计。
  • The impact on database also depends on other queries being run either directly by users or as part of a query running via the actual application.对数据库的影响还取决于用户直接运行的其他查询,或者作为通过实际应用程序运行的查询的一部分。
  • You can check all the processes running and have a look at your query using the sp_who command.您可以使用 sp_who 命令检查所有正在运行的进程并查看您的查询。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM