如何将excel电子表格导入SQL Server? [英] How do I import an excel spreadsheet into SQL Server?

查看:385
本文介绍了如何将excel电子表格导入SQL Server?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将excel电子表格导入到SQL Server 2005中。我需要采取哪些步骤才能实现?

解决方案

数据转换服务向导是您的朋友。



这里的说明假定为SQL Server 2000




  • 打开SQL Server企业管理器

  • 右键单击相应的服务器

  • 选择导入数据

  • 运行向导。


    • 在第一个屏幕上单击下一步

    • 选择Microsoft Excel作为数据源

    • 输入XLS文件的路径,然后单击下一步。

    • 输入数据库的连接详细信息,然后单击下一步。

    / li>


根据您对数据的处理方式,您可以选择新的选项。对于一次性作业,我通常发现导入所有excel数据最简单,然后在SQL Server中编辑它,但如果要在多个文件上重复此操作,则可能需要制作一个非常性感的导入脚本。 / p>

如果要再次运行,可以使用向导保存DTS包,然后在企业管理器的数据转换服务部分进行编辑。这是学习DTS如何工作的好方法。


I need to import an excel spreadsheet into SQL Server 2005. What steps would I need to take to accomplish that?

解决方案

The "Data Transformation Services" wizards are your friend.

The instructions here assume SQL Server 2000

  • Open SQL Server Enterprise Manager
  • Right-click on the appropriate server
  • Select Import Data
  • Run through the wizard.
    • Click Next on the first screen
    • Choose "Microsoft Excel " as your datasource
    • Enter the path to the XLS file and click next.
    • Enter the connection details for your database and click next.

Depending on what you want to do with the data, you have a few options new. For one-off jobs I generally find it easiest to import all the excel data, then edit it in SQL Server, but if you're going to repeat this action on multiple files, you might want to craft a really sexy import script.

If you are going to run it again, you can save the DTS package using the wizard, then edit it in the "Data Transformation Services" section of Enterprise Manager. It's a good way to learn how DTS works.

这篇关于如何将excel电子表格导入SQL Server?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆