Hello everyone,
I'm not really a programmer, but need help writting stored procedure that will copy data from an source table (a result of importing data from a text file using DTS) to a destination table with more columns and some data transformation along the way. Here are the table structures:
DESTINATION table
- Seq (int)
- CommDate (smalldatetime)
- Position (char)
- EmpID (char)
- Datasource (char)
- Sales (int)
- Workday (int)
- TrxnStamp (smalldatetime)
SOURCE table
- CommDate (char)
- Position (char)
- EmpID (char)
- Sales (int)
- Workday (int)
I have to loop through the entire SOURCE table and take each record and insert it into the DESTINATION table. Along the way, I have to convert (string manipulations and arithmatic operations) the CommDate (char) into smalldatetime, add the other fields.
There is no field in the SOURCE table that I can use as a counter so how do I loop through it?
Thank you very much in advance,
dragony
I'm not really a programmer, but need help writting stored procedure that will copy data from an source table (a result of importing data from a text file using DTS) to a destination table with more columns and some data transformation along the way. Here are the table structures:
DESTINATION table
- Seq (int)
- CommDate (smalldatetime)
- Position (char)
- EmpID (char)
- Datasource (char)
- Sales (int)
- Workday (int)
- TrxnStamp (smalldatetime)
SOURCE table
- CommDate (char)
- Position (char)
- EmpID (char)
- Sales (int)
- Workday (int)
I have to loop through the entire SOURCE table and take each record and insert it into the DESTINATION table. Along the way, I have to convert (string manipulations and arithmatic operations) the CommDate (char) into smalldatetime, add the other fields.
There is no field in the SOURCE table that I can use as a counter so how do I loop through it?
Thank you very much in advance,
dragony