dbTalk Databases Forums  

DTS Transformation Script & Identity Column...

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss DTS Transformation Script & Identity Column... in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Greg
 
Posts: n/a

Default DTS Transformation Script & Identity Column... - 07-06-2004 , 02:31 PM






I have a small table consisting of three columns (identity, varchar, and
datetime). I have to import a text file containing strings into the table.
Each line of the text file is a row to be imported. Since the datetime
column can't be empty I'm modifying the transformation script. I've added:
DTSDestination("dt") = Now. I have no idea if that will work or not. My
problem is coming from the identity column. I have no identity number to
provide and it won't work without one. How can I modify my script to tell
it to create it's own number? That's why I set the column to identity -- so
I wouldn't have to provide a number.

Here's my script:

Function Main()
DTSDestination("vrtext") = DTSSource("Col002")
DTSDestination("dt") = Now
Main = DTSTransformStat_OK
End Function

Any help would be greatly appreciated.



Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: DTS Transformation Script & Identity Column... - 07-06-2004 , 03:06 PM






Have a read of my article here

Problems With IDENTITY() and the DataPump task.
(http://www.sqldts.com/default.aspx?293)


And also have a look at this

Formatting Character Data into Datetime fields
(http://www.sqldts.com/default.aspx?249)


Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.