|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Execute DTS from ASP.NET
hi,
I have a DTS Package in SQL Server. I need to execute it from ASP.NET. ASP.Net server and SQL Server are in different machine. even ASp.Net server has not Sql server client version. So, It has not dtspkg.dll. The situation is cannot register dll in asp.net server. There is one option to execute this is xp_cmdshell. But it is possible for security reason. So, I need to execute dts pacakge directly from sqlserver. Is it any way to do this? Please help.. thanks in advance. Regards, Dharmaprakash. |
|
#2
|
|||
|
|||
|
That's ok, you probably don't want to be letting an ASP app running a command shell unless you have to since that elevates the priviledges.
try calling the DTS package from a Stored Procedure |
|
#3
|
|||
|
|||
|
DTS from asp.net
copy dtspackage.dll to the webserver and register it. Add reference to dtspackage from visual studio.
the following code will execute Dim objDTS As New DTS.Package Dim objStep As DTS.Step Dim sSrc, sDsc As String Dim dErr As Double 'Glb_SrvName = "Server" 'glb_username = "Admin" 'Glb_PassWd = "Admin123" GetConnectionInfo() 'objDTS.DTSSQLStgFlag_Default Dim obj As Object obj = DTS.DTSSQLServerStorageFlags.DTSSQLStgFlag_Default Try objDTS.LoadFromSQLServer(Glb_SrvName, glb_username, Glb_PassWd, 0, , , , "DTSToExecute") For Each objStep In objDTS.Steps objStep.ExecuteInMainThread = True Next objDTS.Execute() For Each objStep In objDTS.Steps If objStep.ExecutionResult = DTS.DTSStepExecResult.DTSStepExecResult_Failure Then objStep.GetExecutionErrorInfo(dErr, sSrc, sDsc) Response.Write(sSrc & vbCrLf & sDsc) End If Next objDTS = Nothing lblMsg.Visible = True lblMsg.Text = " Data Updated Successfully " Catch ex As Exception lblMsg.Visible = True lblMsg.Text = ex.Message Exit Sub End Try |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft SQL Server > Execute DTS from ASP.NET |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|