将超过 1000 行从 Excel 插入 SQLServer [英] Inserting more than 1000 rows from Excel into SQLServer

查看:41
本文介绍了将超过 1000 行从 Excel 插入 SQLServer的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 Sql 新手,但是将 1000 多行从 excel 文档插入我的数据库的最佳方法是什么(Sql server 2008.)

I'm new to Sql but what is the best way to insert more than 1000 rows from an excel document into my database(Sql server 2008.)

例如,我正在使用以下查询:

For example I'm using the below query:

   INSERT INTO mytable(companyid, category, sub, catalogueref)
   VALUES
   ('10197', 'cat', 'sub', '123'),
   ('10197', 'cat2', 'sub2', '124')

这工作正常,但有插入 1000 条记录的限制,我有 19000 条记录,我真的不想做 19 条单独的插入语句,另一个问题是,公司 ID 总是相同的写 19000 次更好吗?

This is working fine but there is a limit of inserting 1000 records and I have 19000 records and I don't really want to do 19 separate insert statements and another question, is that the company id is always the same is there a better way then writing it 19000 times?

推荐答案

微软提供了一个导入向导 与 SQL Server.我用它从其他数据库和电子表格中迁移数据.它非常强大且易于使用.

Microsoft provides an import wizard with SQL Server. I've used it to migrate data from other databases and from spreadsheets. It is pretty robust and easy to use.

这篇关于将超过 1000 行从 Excel 插入 SQLServer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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