![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
-----Original Message----- Hi, I need assistance with DTS. I'm able to set up a package that reads from a Text file and transforms everything correctly into a SQL Server 2000 DB. Unfortunately, I'm unable to: a) Set up said package to accept varying text file names as the source. (I can't find how to get Dynamic Properties Task to accept Global variables. Everything I have seen isn't very comprehensive) b) Pass the filename via ASP to the DTS package.(Tried passing Global variables through stored proc, but no luck) c) Execute the DTS package from ASP. (I tried doing this from a stored proc, xp_cmdshell, but to no avail... lack of permissions) I'm obviously a NooB to DTS. Does anyone know a place that will hold my hand as I try to complete these steps? I've scoured sqldts.com, dbforums and others, but I am unable to find something comprehensive that will assist me in working with ASP and DTS. Thanks you for your assistance!!! . |
#3
| |||
| |||
|
#4
| ||||
| ||||
|
|
Thanks for the reply. Is it possible to send global variables directly from asp? |
|
Everything I have read says that it is necessary to call the dts package through a stored proc and pass the global variables through the stored proc. Ideally, I would like to pass directly from asp. Is this possible? I tried the stored proc route and i'm having errors with xp_cmdshell. |
|
Also, why can I run the dts package from EM without incident, |
|
but when I try and execute it from asp i receive: Executing pkgConvertFlatFile from localhost Step [DTSStep_DTSDataPumpTask_1] failed Task "Transform Data Task: undefined" Package [pkgConvertFlatFile] failed |
#5
| |||
| |||
|
|
-----Original Message----- In article <9f6301c35c3c$f475f470$a001280a (AT) phx (DOT) gbl>, Jeff Borden jeff_borden (AT) hotmail (DOT) com> writes Thanks for the reply. Is it possible to send global variables directly from asp? Yes. Just prior to calling the execute method you can set the package's global variables, e.g. oPkg.GlobalVariables("VariableName").Value = "ASPValue" Everything I have read says that it is necessary to call the dts package through a stored proc and pass the global variables through the stored proc. Ideally, I would like to pass directly from asp. Is this possible? I tried the stored proc route and i'm having errors with xp_cmdshell. If using xp_cmdshell then you can use DTSRUN with the /A parameters to set global variable values. DTSRUN is fully documented in Books Online including the /A parameter. If you want help with the dtsrun command line syntax, try the dtsrunui.exe tool. Select the package and click Advanced. Use the command line generation options available. Also, why can I run the dts package from EM without incident, Totally different security context and execution location. DTS is a client side tool so just like any other COM object called via ASP it executes under the IUSER_account on the web server, not on the SQL server or your desktop as when developing through Enterprise Manager. There is some stuff in this article, when I suggest using a COM object set under COM+ with a named account. Also includes sample code. Execute a package from Active Server Pages (ASP) http://www.sqldts.com/default.aspx?6,104,207,7,1 but when I try and execute it from asp i receive: Executing pkgConvertFlatFile from localhost Step [DTSStep_DTSDataPumpTask_1] failed Task "Transform Data Task: undefined" Package [pkgConvertFlatFile] failed You really need to get the error message from the step but this requires a string typed language. This is another reason why I like the COM+ approach. The change security context and execution location is also explained in this article albeit in a different context- INF: How to Run a DTS Package as a Scheduled Job http://support.microsoft.com/?kbid=269074 -- Darren Green (SQL Server MVP) DTS - http://www.sqldts.com . |
#6
| |||
| |||
|
|
Darren, Thanks for taking the time to reply. This is my first stab at DTS, and it's been a rocky one. When I try and execute the package from ASP, sans the Global variables, it gives the error I previously posted. I just wanted to post the error that the package log returned to me: Step Error Source: Microsoft OLE DB Provider for SQL Server Step Error Description:Login failed for user 'BORDEN\IWAM_JBENNETT'. Step Error code: 80040E4D Step Error Help File: Step Error Help Context ID:0 Obviously there is a permissions error. I will now look over the articles you posted previously, and hopefully put this behind me. Thanks! |
#7
| |||
| |||
|
|
Wow, you were right. COM+ was the easiest solution for this. It's working quite well with a static text source file. I now need to figure out how I can pass to the package the variable text source as a global variable. I followed the steps that Sesha mentioned in a previous post (i.e. setting up the package to receive global variables). When I tried to implement the code you provided me, to pass the global variable, it threw me an error. You provided me with: oPkg.GlobalVariables("VariableName").Value = "ASPValue" The important part of my code is as follows: Dim oExecDTS Dim sServer, sPackageName Dim bResult sServer = "localhost" sPackageName = "pkgConvertFlatFile" sPackageName.GlobalVariables ("DTSTextSource").Value = Request.Form("txtServer") Set oExecDTS = CreateObject ("SQLDTS_ExecDTS.ExecutePackage") ) The above code throws the error: Object required: 'pkgConvertFlatFile' Any thoughts on how this can be remedied? Thanks for your time and help. |
#8
| |||
| |||
|
|
Thanks again for the reply. Unfortunately I'm not very knowledgeable when it comes to COM, hence my hesitance to use it. I'm using visual studio.net, and it appears the component was compiled in VS6. Are there any extraneous considerations if I upgrade it to .NET, or does it even matter? The line you provided: oPKG.GlobalVariables("VariableName").Value = sTextFile shows the error: Interface 'DTS GlobalVariables' cannot be indexed because it has no default value Will that error ruin the Component? Finally, what is the best way to save the component once all of the code is in place? Thanks for your patience and time! |
#9
| |||
| |||
|
#10
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |