-1

I am trying to upload data to a sql server database table from a delimited file via a SSIS package but its throwing error

The value could not be converted because of a potential loss of data

These SSIS packages have been recently moved from Visual Studio 2008 to VS2010 / 2012. Other tables in sqp are getting uploaded without any errors.

Ardalan Shahgholi
  • 11,967
  • 21
  • 108
  • 144
arvind
  • 11
  • 1
  • 1
    What is the width of the column in the DB and the width as decided by SSIS? – Raj Jan 27 '16 at 08:44
  • Hi, Thanks for taking time to respond to my query. I'm trying to transport data in 'two byte signed integer{DT_I2} from flat file connection manager to Small Int field in SQL server 2012.Could you suggest what can be done in this? – arvind Jan 27 '16 at 12:38
  • 1
    Possible duplicate of [SSIS - the value cannot be converted because of a potential loss of data](http://stackoverflow.com/questions/11742496/ssis-the-value-cannot-be-converted-because-of-a-potential-loss-of-data) – Tab Alleman Jan 27 '16 at 14:18

1 Answers1

0

According to your descriptions.The reasons are as follows.

1.The contents of the flat file field are greater than the maximum length of the table field. 2.You can select Execution Results,yon can see details of error information.

Tiger
  • 18
  • 4
  • Hi, Thanks for taking time to respond to my query. I'm trying to transport data in 'two byte signed integer{DT_I2} from flat file connection manager to Small Int field in SQL server 2012.Could you suggest what can be done in this? – arvind Jan 27 '16 at 12:35
  • You can convert data by script componet. – Tiger Jan 27 '16 at 12:41
  • 1
    A two byte int won' fit into a `tinyint`. If you check inline, a `tinyint` is only one byte. So you need to change the target datatype or work out if the {DT_I2} definition is correct. Here's what google says. https://msdn.microsoft.com/en-AU/library/ms187745.aspx?f=255&MSPPError=-2147217396 – Nick.Mc Jan 27 '16 at 13:13
  • Hi, its in `smallint` should this be accomodated in `bigint` then – arvind Jan 28 '16 at 04:34
  • Oh sorry I misread. a two byte int _should_ fit into `smallint`... but since it doesn't, try an `int` before you try a `bigint` – Nick.Mc Jan 28 '16 at 04:37