![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
| Hi people, I need to extract 6 views to the same Excel file. I have to extract many times. So I think: create a DTS package and create a Global Variable with the name of the file, so I can run the package passing the name of the file. Does anyone have any example of this kind of configuration? Thanks a lot, Cristiana *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#3
| |||
| |||
|
#4
| |||
| |||
|
#5
| |||
| |||
|
|
Just one more question, how can I associate the global variable to the Connection Data Source? (Dynamic Properties?) *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#6
| |||
| |||
|
#7
| |||
| |||
|
| Hi Allan, I did the following: Opened the Import & Export Wizard and made an export the 6 views to Excel. At the end, I saved the package. After this, I have opened the DTS Designer. I can see 6 groups like this: Execute SQL Task -> Connection to DB -> Excel File In the icon of Excel file, I have the 3 names 'Connection 2' and the other ones are 'Connection 4' So, I have created the Global Variable called filename. After this, I put a Dynamic Properties Task, pointing the Connection 2 DAtaSource to Global Variable filename and pointing Connection 4 DAtaSource to Global Variable filename. After this I run the package in Query Analyser: exec master.dbo.xp_cmdshell 'dtsrun /Smyserver /E /Pmscsql /NTeste21jan' It works ok, creating the file that was defined in Import/Export Wizard (exportado.xls). After this, I tried: exec master.dbo.xp_cmdshell 'dtsrun /Smyserver /E /NTeste21jan /Afilename:8="c:\testecomVAR.xls"' and exec master.dbo.xp_cmdshell 'dtsrun /Smyserver /E /NTeste21jan /Afilename:8=c:\testecomVAR.xls' So, I have received many messages like this: DTSRun OnFinish: Create Table 7_HC_EXP Step DTSRun OnProgress: Copy Data from 7_HC_EXP_18_20040117 to 7_HC_EXP Step; 1 Rows have been transformed or copied.; PercentComplete = 0; ProgressCount = 1 DTSRun OnFinish: Copy Data from 7_HC_EXP_18_20040117 to 7_HC_EXP Step DTSRun OnError: Create Table 6_AIR_EXP Step, Error = -2147217900 (80040E14) Error string: Table '6_AIR_EXP' already exists. Error source: Microsoft JET Database Engine Help file: Help context: 5003010 Error Detail Records: Error: -2147217900 (80040E14); Provider Error: -534840599 (E01EFAE9) Error string: Table '6_AIR_EXP' already exists. Error source: Microsoft JET Database Engine Help file: Help context: 5003010 DTSRun OnFinish: Create Table 6_AIR_EXP Step DTSRun: Package execution complete. ============ I can see the package run and mades a append in the file exportado.xls. I think it is not reading my global variable.... What I'm doing wrong? Thanks a lot~! Cristiana *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#8
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |