All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
怎样在Web开发中完美控制IE标题栏_[Asp.Net教程]
数据库技巧之建立一个传表名参数的存储过程_[SQL,Server教程]
.net发送邮件的一些技巧_.net资料_编程技术
MFC应用程序的开发流程
js代码小记(判断textbox的长度,并且固定最多收入字符)_JavaScript技术_编程技术
C#生成静态页面的分页程序_[Asp.Net教程]
TreeView服务器控件的功能和属性
一个功能齐全的DataGrid分页例子_[Asp.Net教程]
ASP.net,做的IP,访问限制_[Asp.Net教程]
asp.net在ie里调试_.net资料_编程技术
Reading number is top 10 pictures
The money of more than 100 countries and regions14
The money of more than 100 countries and regions22
A man's favorite things11
A man's favorite things4
新版武松打虎
NeedWallpaper12
Ashlynn Brooke a group sexy photo1
2012 national geographic daily picture5
Small QiShu -- ShuangShuangPan1
赵惟依写真1
Download software ranking
Unix video tutorial20
Boxer's Top ten classic battle2
Call Of Duty5
dreamweaver8中文版
网络管理员第三版
Tram sex maniac 2 (H) rar bag16
虚拟机汉化软件
I'm come from Beijing2
WebService在.NET中的实战应用教学视频 → 第1集
jdk1.5
delv published in(发表于) 2013/12/30 4:37:14 Edit(编辑)
SQL,Server使用Bulk,Insert把一个文本导入到数据库_mssql学习_编程技术

SQL,Server使用Bulk,Insert把一个文本导入到数据库_mssql学习_编程技术

SQL Server使用Bulk Insert把一个文本导入到数据库_mssql学习_编程技术-你的首页-uuhomepage.com
This is very common request recently – How to import CSV file into SQL Server? How to load CSV file into SQL Server Database Table? How to load comma delimited file into SQL Server? Let us see the solution in quick steps.
CSV stands for Comma Separated Values, sometimes also called Comma Delimited Values.
Create TestTable
USE TestData
GO
CREATE TABLE CSVTest
(ID INT,
FirstName VARCHAR(40),
LastName VARCHAR(40),
BirthDate SMALLDATETIME)
GO
Create CSV file in drive C: with name csvtest.txt with following content. The location of the file is C:\csvtest.txt
1,James,Smith,19750101
2,Meggie,Smith,19790122
3,Robert,Smith,20071101
4,Alex,Smith,20040202
Now run following script to load all the data from CSV to database table. If there is any error in any row it will be not inserted but other rows will be inserted.
BULK
INSERT CSVTest
FROM 'c:\csvtest.txt'
WITH
(
FIELDTERMINATOR = ',',
ROWTERMINATOR = '\n'
)
GO
--Check the content of the table.
SELECT *
FROM CSVTest
GO
--Drop the table to clean up database.
SELECT *
FROM CSVTest
GO




添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.