Subject: dts problem
Posted By: garg Post Date: 10/2/2006 12:45:21 PM
text file


ProductName,ProductPrice
Polo,49.95
Khaki,29.95
Cardigan,19.99
HomeComing,99.99
Wedding,199.99


destination

Productid (primary key)
product name
product price


how to create dts package i am facing key vilotion problem


Reply By: dparsons Reply Date: 10/2/2006 1:07:03 PM
set your productID to Auto Increment, when you run the DTS map productname and price to the right columsn, dont map anything to the pk field (SQL will fill it in automatically).

--Stole this from a moderator

I will only tell you how to do it, not do it for you.  
Unless, of course, you want to hire me to do work for you.
Reply By: garg Reply Date: 10/2/2006 1:37:58 PM
thanks i want to do my own job but i set auto increment property but dont know why still is a problem

Reply By: garg Reply Date: 10/2/2006 1:43:05 PM
i found enable to insert null data

Reply By: garg Reply Date: 10/2/2006 2:00:16 PM
CAN YOU HELP



Reply By: dparsons Reply Date: 10/2/2006 2:17:42 PM
What are you importing your data from? CSV?  

If you are getting the error "Unable to Insert 'NULL' into column ProductID, column does not allow for Nulls. Insert Fails.'  

It means either A)You have not set the column to auto inc or B)You are trying to insert data into that field that is Null.  

Consider this:  
I have a DTS on my SQL Server that has 3 steps

Step 1: Truncate Table X
    -Table X has 4 fields
        -pk (integer, pk, auto inc)
        -column1 varhcar
        -column2 varchar
        -column3 varchar
Step 2: DataPump from a CSV file
     -On my transformation tab for the data task, my CSV has 3 columns and my Destination has 4, align the correct source with the correct destination.
Step 3: Copy this data to another table based upon the pk.  

hth




--Stole this from a moderator

I will only tell you how to do it, not do it for you.  
Unless, of course, you want to hire me to do work for you.
Reply By: garg Reply Date: 10/2/2006 2:56:03 PM
thanks i was doing silly mistake


Reply By: dparsons Reply Date: 10/2/2006 3:20:39 PM
Glad you worked it out.

--Stole this from a moderator

I will only tell you how to do it, not do it for you.  
Unless, of course, you want to hire me to do work for you.

Go to topic 50509

Return to index page 159
Return to index page 158
Return to index page 157
Return to index page 156
Return to index page 155
Return to index page 154
Return to index page 153
Return to index page 152
Return to index page 151
Return to index page 150