MS SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMS SQL Development

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 Dev Shed Forums Sponsor:
  #1  
Old November 23rd, 2004, 12:27 AM
indaravind indaravind is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 6 indaravind User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Copying SQL database from one server to other



Hi All,

I need to take a copy of a database present in a SQL server to other SQl server using VB.net code.
I can make it out with wizards but i need the query to execute it thru vb.net.

Thanks
Aravind....

Reply With Quote
  #2  
Old November 23rd, 2004, 01:25 AM
eddyskippy eddyskippy is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 2 eddyskippy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Cool copy via dts

Hi,
1. create a dts package
2. Execute that package from code.

Public Sub dtsstart(DtsName As String)

Dim oPackage As New dts.Package
On Error GoTo eh

Dim sServername
Dim sUid
Dim SPwd

sServername = ""
sUid = ""
SPwd = ""

oPackage.LoadFromSQLServer sServername, sUid, SPwd, _
DTSSQLStgFlag_Default, "", "", "", DtsName, 0
'Execute the Package
oPackage.Execute

frmLog.WriteLine oPackage.Description & vbCrLf, vbBlue

'Clean up.
Set oPackage = Nothing
Exit Sub
eh:
MsgBox Err.Description, vbCritical, _
"Error refreshing "

End Sub

Best regards
Eddy

Reply With Quote
  #3  
Old November 23rd, 2004, 01:46 AM
indaravind indaravind is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 6 indaravind User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks but our sql servers are in a workgroup, so DTS wll not work..

Is there any other solution to copy data from one SQL server to other

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMS SQL Development > Copying SQL database from one server to other


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 2 hosted by Hostway
Stay green...Green IT