Solved

bulk insert in ssis

Posted on 2011-03-12
3
504 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
  • 2
3 Comments
 
LVL 15

Accepted Solution

by:
Aaron Shilo earned 500 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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Solution for warm standby SQL server 20 39
Need a starter for ETL protocol? 4 42
Sql query 107 27
MS SQL Pivot table help 4 14
I wrote this interesting script that really help me find jobs or procedures when working in a huge environment. I could I have written it as a Procedure but then I would have to have it on each machine or have a link to a server-related search that …
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Viewers will learn how the fundamental information of how to create a table.

920 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now