本文章简单的介绍了关于mssqlserver中BULK INSERT大批量导入数据 SQL SERVER ,有需要学习的同学可以测试一下。
开门见山,直接以例子介绍:
代码如下 |
复制代码 |
CREATE TABLE [dbo].[course](
[id] [int] NULL,
[name] [nvarchar](50) NULL,
[CourseType] [nvarchar](50) NULL,
[Course] [float] NULL
)
|
导入数据:
将下面的数据存储为文本文件或SQL文件
2,李刚,语文,89;3,李刚,数学,79;3,李刚,英语,69;4,李刚,化学,89
导入语句:
代码如下 |
复制代码 |
BULK INSERT dbo.course
FROM 'd:course.txt '
WITH
(
FIELDTERMINATOR = ',',
ROWTERMINATOR = ';'
)
|
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn