Exporting From SQL Server to Text file using DTS | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Exporting From SQL Server to Text file using DTS

I wanted to know if I could Export a Table to a Text File. Now the complex thing is the File Name is to be Dynamically Generated. It is based on today’s date. So if the date today is 11/15/2006 then the file name has to be Extract-20061115.txt. I am trying this in a DTS package but till now no luck. Through the Avtivex I have generated the file name Function Main()
DTSGlobalVariables("FileName").value = "U:TestExtract-" + cstr(year(date)) + cstr(month(date)) + cstr(day(date)) + ".txt" rem MsgBox DTSGlobalVariables("FileName").value Main = DTSTaskExecResult_Success
End Function But do not know how to use this global variable value as the destination table name. Thanks
George

is this give you a solutionhttp://www.thescripts.com/forum/thread82137.html —————————————-
Contributing Editor, Writer & Forums Moderator
http://www.SQL-Server-Performance.Com Visit my Blog at
http://dineshasanka.spaces.live.com/

]]>