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

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

问题描述

我是Sql的新手,但是将excel文档中的1000多个行插入到我的数据库中的最佳方法是什么(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?

推荐答案

Microsoft提供了导入向导与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.

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

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