![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, I have a dts package that has 23 ExecuteSqlTasks. I know how to loop through each task. What I want to do is change the Sql Statement. The problem is the sql script I have is about 800 lines long. How do I assign the script.sql file into a global variable and then assign it to "oTask.customTask.SqlStatement = ". Here is the code. Dim oPackage Dim oTask set oPackage = DTSGlobalVariables.Parent For Each oTask in oPackage.tasks If oTask.CustomTaskID = "DTSExecuteSQLTask" then msgbox oTask.Name msgbox oTask.Description oTask.customTask.SqlStatement = End IF Next Main = DTSTaskExecResult_Success Thanks Ron Sissons, DBA Information Technology Services Riverside County Office of Education 3939 Thirteenth Street, Riverside, CA 92502-0868 Telephone: (909) 826-6471; FAX: [909] 826-6451 |
#3
| |||
| |||
|
|
K<anonymous (AT) discussions (DOT) microsoft.com> 4/27/2004 9:16:04 AM Hello Ron;One other option would be to output the sql code to a text file |
#4
| |||
| |||
|
|
Since I have the script execute on 23 different databases, I don't want to create a SP. I want to be able to change the sql statement of the executesql task by using a script.sql file. That way if I change the script, i can update all the executesql tasks in my package. SO my qwuestion is: how do I assing the file to a global variable and then assign it to "oTask.customTask.SqlStatement = gv_sqlscript". See my answer to your separate question on this, but the quick answer is |
![]() |
| Thread Tools | |
| Display Modes | |
| |