问题描述
您好,
我对此查询有疑问: -
BEGIN
truncate table dbo.BaaN_BOM
BULK
INSERT dbo.BaaN_BOM
FROM ' C:\ OutpututFiles; \\ BOM。 txt'
WITH
(
FIELDTERMINATOR = ' |',
ROWTERMINATOR = ' \\ \\ n'
)
结束
此表中有四列。
DataBase dbo.BaaN_BOM表: - CustID(varchar(max)),CustomerName(varchar(max))地址(varchar(max))ErrorIndicator(int )
BOM.txt: - CustID |客户名称|地址| ErrorIndicator
C_001 | Raj | Noida | 1
C_002 | Jason |澳大利亚| 0
C_003 | Nathan |英格兰| 1
C_004 | Ankit |印度| 1
所以,
我想将BOM.txt中的数据填充到My dbo.BaaN_BOM表中,但我遇到ErrorIndicator
的问题,因为它是整数类型并填充了此查询中的数据,如: -
CustID客户名称地址ErrorIndicator
CustID客户名称地址ErrorIndicator
C_001 Raj Noida
我想只填充数据而不是列插入,那么,怎么可能。
请帮帮我。
在此先感谢
Ankit
软件工程师
Hello,
I have a problem with this query:-
BEGIN truncate table dbo.BaaN_BOM BULK INSERT dbo.BaaN_BOM FROM 'C:\OutputFiles\BOM.txt' WITH ( FIELDTERMINATOR = '|', ROWTERMINATOR = '\n' ) end
Four columns in this table.
DataBase dbo.BaaN_BOM Table:- CustID (varchar(max)), CustomerName(varchar(max)) Address(varchar(max)) ErrorIndicator (int)
BOM.txt:- CustID|CustomerName|Address|ErrorIndicator
C_001|Raj|Noida|1
C_002|Jason|Australia|0
C_003|Nathan|England|1
C_004|Ankit|India|1
So,
I want to fill data from BOM.txt to My dbo.BaaN_BOM table but i have problem with ErrorIndicator
because It''s a Integer Type and filled the data from this query like:-
CustID CustomerName Address ErrorIndicator
CustID CustomerName Address ErrorIndicator
C_001 Raj Noida
I want to only data fill not column insert, So,How it can be possible.
Please help me.
Thanks in Advance
Ankit
Software Engineer
这篇关于如何在没有第一行的情况下将数据从管道分离文件导入数据库表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!