Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2002-02-19 : 13:20:13
|
| Jeffrey writes "Hello,I am a SQL Server / Visual Basic programmer and I have this situation.....I have a customer database of which I need to pull credit reports. I setup a DTS to create the flat file to feed into my credit software and it pulls credit reports just fine.Now I need to look at the individual text files (credit reports) examine the 1st three lines and match that to a customer in my database. Then I need to change the name of the file from the persons last name to their phone number (our primary key).I have VB Code that does this function, but I would prefer to use something server side... Any ideas ??...Jeff" |
|
|
MichaelP
Jedi Yak
2489 Posts |
Posted - 2002-02-19 : 13:32:12
|
| I'm not sure if older versions of SQL Server support this, but I know with SQL 2000 you can add a "ActiveX Script Task" that you can have run "On Completion" of your import task. This allows you to write VBScript code to do whatever you need. You can instatiate the FileSystemObject and rename the file as needed. You can also read the text file and pull out the data you need to use to rename it.You will probably need to read teh text file in one task, and set that value to a global variable. Add a second task to query the database, and a thrid to actually rename the fileMichael michaelp@televox.com |
 |
|
|
|
|
|