dsachtleben
asked on
Autofill an identitly field using an activex script in DTS
I have a vbscript that copies and transforms data from an access table to and existing MSSQL table. The destination table has an identity column, and I need to autopopulate it as the data is loaded. I'm thinking the line of code would look something like:
DTSDestination("id") = ?
where ? is a command to autoincrement the id by 1. Hopefully this is just a syntax question. Thanks.
DTSDestination("id") = ?
where ? is a command to autoincrement the id by 1. Hopefully this is just a syntax question. Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for help! I am obviously new to DTS but this was a very clear solution.
Don't get too familiar! It will probably change next version of SQL Server! than again that is a couple of years away.
There are a lot of handy exmpaples here: SQLDTS.COM
There are a lot of handy exmpaples here: SQLDTS.COM
For example:
Function Main()
DTSDestination("FieldName"
DTSGlobalVariables("NewID"
Main = DTSTaskExecResult_Success
End Function