Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/sql-server-2008/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/file/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql server 2008 SQL Server批量插入语法_Sql Server 2008 - Fatal编程技术网

Sql server 2008 SQL Server批量插入语法

Sql server 2008 SQL Server批量插入语法,sql-server-2008,Sql Server 2008,如何为该平面文件编写大容量插入T-SQL查询 7273|80110200|1 8152|58130103|1 10715|87480302|1 20462|76991103|1 21964|72159903|1 25537|59219900|1 30600|58120310|1 我想知道如何定义字段终止符和行终止符,请尝试以下操作: BULK INSERT test.dbo.bulkinserttest -- your target table here (db).(schema).(tab

如何为该平面文件编写大容量插入T-SQL查询

7273|80110200|1
8152|58130103|1
10715|87480302|1
20462|76991103|1
21964|72159903|1
25537|59219900|1
30600|58120310|1

我想知道如何定义字段终止符和行终止符,请尝试以下操作:

BULK INSERT test.dbo.bulkinserttest  -- your target table here (db).(schema).(tablename)
FROM 'd:\test.txt'    -- that's the path to your file with the data
WITH
(
    CODEPAGE = 'ACP',
    DATAFILETYPE = 'char',
    FIELDTERMINATOR ='|',
    ROWTERMINATOR = '\n'
)

这是一篇精彩的文章,您可以查看更多详细信息。

试试下面的内容:

BULK INSERT test.dbo.bulkinserttest  -- your target table here (db).(schema).(tablename)
FROM 'd:\test.txt'    -- that's the path to your file with the data
WITH
(
    CODEPAGE = 'ACP',
    DATAFILETYPE = 'char',
    FIELDTERMINATOR ='|',
    ROWTERMINATOR = '\n'
)
这是直接从精彩的,你可以检查进一步的细节