error in transforming the excel data to sql server using DTS??

anand

Well-known member
Joined
Jan 29, 2003
Messages
76
Location
chicago
Hi friends
I am learning DTS now...I am trying to transfer the data from excel to sql server using DTS...i am getting an error..type mismatch DTSSource

my code in active script is

Function Main()
thesno=DTSSource("sno")
if thesno >1 then
DTSDestination("sno")=thesno
else
DTSDestination("sno")=thesno+10
end if
Main = DTSTaskExecResult_Success
End Function


i have a column "sno" in both excel sheet and in my sql table (stud)

can u pls tell me whats my mistake..pls give me a idea how to write DTS Active script..

lot of thanks
Satya
 
At first glance it looks like there is a cell of data in the excel spreadsheet that doesnt meet the data type of the column youre trying to put it in. Just to test this hypothesis, you might create a simpler spreadsheet with only 2 or 3 rows and confirm that all the data in those 2 or 3 rows meets the constraints of the database columns. Then import this. If it works, you know Im right and you need to fix the source.
 
Hi Tim
Still i am getting the same error..i took only 2 cols in spread sheet both are integer type and i created a table with 2 cols in sql server ..both cols are integer type...when i write the script its giving the same error..DTS Source..vb script runtime error..can u pls send me a small sample code of active script...lot of thanks for your time....
Satya
 
Back
Top