Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

bulk insert in ssis

Posted on 2011-03-12
3
Medium Priority
?
517 Views
Last Modified: 2012-05-11
BULK INSERT [TestDB].[dbo].[TestTable] FROM 'C:\importedtxt' WITH(BATCHSIZE=1000,CODEPAGE='RAW',DATAFILETYPE='char',FIELDTERMINATOR='\t',ROWTERMINATOR='\n')


I'm running this via SSIS bulk insert component, my concern is with datafiletype=Char, so when I do bulk insert will it truncate any char long during bulk insert operation ? when I'm doing bcp, I'm also choose -c for data type but I'm not sure if when we bcp out the data will it cover all data which I have in the database, how about if I'm using widechar ? will it better ?
0
Comment
Question by:motioneye
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 15

Accepted Solution

by:
Aaron Shilo earned 1500 total points
ID: 35121369
1. bcp will truncate the long char.
2. yes using widechar will minimize charecter loss if the source or dest are not unicode.
0
 

Author Comment

by:motioneye
ID: 35125700
So,
If I have following table structure, will using -N in bcp and "widenative"  during bulk insert is guarantee data will not get truncate ?

CREATE TABLE [dbo].[TestTable](
      [time] [datetime] NOT NULL,
      [eventid] [int] NOT NULL,
      [hostname] [varchar](255) NULL,
      [sessionid] [varchar](255) NULL,
      [username] [varchar](512) NULL,
      [agentname] [varchar](255) NULL,
      [realmname] [varchar](255) NULL,
      [realid] [varchar](64) NULL,
      [client] [varchar](255) NULL,
      [domainoid] [varchar](64) NULL,
      [authdirname] [varchar](255) NULL,
      [authdirserver] [varchar](512) NULL,
      [authdirnamespace] [varchar](255) NULL,
      [resource] [varchar](4096) NULL,
      [status] [varchar](1024) NULL,
      [reason] [int] NOT NULL,
      [transactionid] [varchar](255) NULL,
      [Name] [varchar](255) NULL,
      [computername] [varchar](512) NULL,
      [dirName] [varchar](255) NULL,
      [id] [int] IDENTITY(1,1) NOT NULL,
0
 

Author Closing Comment

by:motioneye
ID: 35186295
Tq
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question