Re: ADO - Copy Data from one data source to another via VB6

From: Doug Stoltz (NoSpam_at_MyEmail.com)
Date: 08/25/04

  • Next message: Doug Stoltz: "Re: Passing VARBINARY/BINARY param to a stored proc"
    Date: Wed, 25 Aug 2004 16:13:13 -0400
    
    

    Look at "linked" servers in enterprise manager. It's under the "security"
    node of the tree. Link the servers and you can copy from server to server
    without pulling records to your EXE.

    Also look at the proc sp_ExecuteSQL in SQL Server books online. This proc
    can be use to run dynamic SQL on the server. You can also create stored
    proc's in the "target" database that take parameters for your where clause.

    -- Sample insert statement that pulls from a linked server
    Insert into TableX (field_a, field_b, field_c)
    select input_a, input_b, input_c from
    ServerX.DatabaseNameY.dbo.InputTableZ

    Good luck (let me know if this works)

    Also, remove your email or you're going to start getting lots of spam. Since
    the newsgroup data can be downloaded spammers will harvest Email addresses
    from the post. (ask me how I know this). Try something like xxxxx at
    mydomain.com. This will thwart the spammers)

    "rmsterling" <rmsterling@avaya.com> wrote in message
    news:F8E2F464-F681-4143-9FAE-4FAA00A5C2B0@microsoft.com...
    > Re: ADO - Copy Data from one data source to another via VB6
    >
    > I have two data sources located on two different servers.
    > Both data sources are defined as a System DSN in the ODBC Administrator.
    >
    > Currently I open both sources using ADO and copy the records from one
    source
    > to another. As there are thousands of records it takes hours to copy the
    data.
    >
    > I noticed if both sources are SQL Server I can use DTS services. The
    problem
    > with this is that the SQL query is fixed. I need to be able to alter it
    from
    > VB6.
    >
    > Does anyone have any VB6 code that does this using a OLE plug-in?
    > OR
    > Does anyone know any other way of performing this task quicker than the
    way
    > I am doing it above?
    >
    > Please post answers to MSDN Newsgroup thread and to my email address
    below.
    >
    > Many thanks in advance.
    >
    > --
    > ----------------------------
    > Regards,
    > Richard Sterling
    > Senior Software Engineer Tel : +44 (0)1707 392200 ext 4815
    > Avaya ECS Ltd, United Kingdom
    > mailto:rmsterling@avaya.com
    >


  • Next message: Doug Stoltz: "Re: Passing VARBINARY/BINARY param to a stored proc"

    Relevant Pages

    • RE: SBS 2003 Unable to connect to database STS_Config
      ... Uninstall the SQL server from the SBS 2k3 server from add/remove programs ... Uninstall Microsoft SQL Server Desktop Engine (SHAREPOINT) ... If AV software install any extra IIS virtual directory, ...
      (microsoft.public.windows.server.sbs)
    • RE: migrating from wmsde to sql server
      ... Click Start, point to All Programs\Microsoft SQL Server, and then click ... then click New SQL Server Registration. ... Microsoft CSS Online Newsgroup Support ... This newsgroup only focuses on SBS technical issues. ...
      (microsoft.public.windows.server.sbs)
    • RE: SBS 2003 Unable to connect to database STS_Config
      ... Uninstall the SQL server from the SBS 2k3 server from add/remove programs ... Uninstall Microsoft SQL Server Desktop Engine (SHAREPOINT) ... If AV software install any extra IIS virtual directory, ...
      (microsoft.public.windows.server.sbs)
    • Re: Best replication architecture?
      ... Looking for a SQL Server replication book? ... So if it is subscribing to Publisher 1, ...
      (microsoft.public.sqlserver.replication)
    • RE: Insufficient memory Available
      ... Insufficient memory available. ... within the scope of SQL Server. ... "MemToLeave" area. ...
      (microsoft.public.sqlserver.server)