Microsoft SQL Server
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft SQL Server

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old October 9th, 2003, 09:26 AM
dharmaprakash dharmaprakash is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: India
Posts: 9 dharmaprakash User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
  #2  
Old October 11th, 2003, 03:03 PM
unatratnag unatratnag is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 312 unatratnag User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 m 6 sec
Reputation Power: 6
Send a message via AIM to unatratnag
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

Reply With Quote
  #3  
Old August 29th, 2006, 04:28 AM
pramodkr pramodkr is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2006
Posts: 1 pramodkr User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m
Reputation Power: 0
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

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft SQL Server > Execute DTS from ASP.NET


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT