Copying data using DTS

  • Using SQL7 I have experinced several times where I am copying one database from one server to another using transfer SQl Server Objects, but the data never gets transfered. has anybody come accross this before?


    -JG

  • yep. hate that task. Unreliable IMHO. I stick to detach/attach or backup/restore

    Steve Jones

    steve@dkranch.net

  • I have found that task to be unreliable. It gets more reliable if you go through the options (options button on transfer tab)and deselect the "transfer database users and database roles" option but, still I opt for specific items transfer and / or scripting.

    Hope this helps.

    OBTW, it does seem more reliable in 2000 although I had such a sour taste from 7.0 I really avoid it.

    David

    David

    @SQLTentmaker

    “He is no fool who gives what he cannot keep to gain that which he cannot lose” - Jim Elliot

  • The easiest way still to perform a dump to a file, transfer the file and perform a manual restore with QA (to specify other file locations, ...)

    This always work.

  • I am taking your advice on backing up and moving the file to the server then performing a restore. I am having trouble with the FileSystemObject Move. What do I have wrong with this code?

     Function Main()
    
    Dim objFSO, strFileSource, strDestination

    Set objFSO = CreateObject ("Scripting.FileSystemObject")

    strFileSource = DTSGlobalVariables("gvFilePathRoot").Value & _
    "\pubs.bak"

    strDestination = DTSGlobalVariables("gvDestinationPath").Value

    If objFSO.FileExists(strFileSource) Then
    strFileSource.Move(strDestination)
    Else
    Main = DTSTaskExecResult_Failure
    Exit Function


    -JG

  • Whats the error? Looks ok, but I'm not sure .Move will overwrite. you might need to delete first.

    Steve Jones

    steve@dkranch.net

  • It errors out on the .Move line. Stating: Object required: 'strFileSource'


    -JG

  • include some msgbox( strFileSource) debug messages to debug this.

    Steve Jones

    steve@dkranch.net

  • I MsgBox strFileSource and strDestination after the IF nad it returns the correct path for the file. very Strange. Still at wits end. Let me know if you see anything else I could possibly check.


    -JG

  • Ahh, I just saw it. In this line:

    strFileSource.Move(strDestination)

    strFileSource is a string variable, not an object. The syntax is object.move( source, destination).

    So you would change to objFSO.Move( strFileSource, strDest).

    Steve Jones

    steve@dkranch.net

  • Steve, that was the solution, in addition, I had to use MoveFile instead of Move.

    objFSO.MoveFile(strFileSourec, strDestination)

    Thanks for the Help! -JG

    Edited by - jgee on 01/11/2002 11:53:50 AM


    -JG

  • glad I could help. Sorry I didn't catch it earlier.

    Steve Jones

    steve@dkranch.net

Viewing 12 posts - 1 through 11 (of 11 total)

You must be logged in to reply to this topic. Login to reply