Re: Insert between separate databases

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



One is a local access database (i.e. on the same box as the .net code being
run on), the other is a remote sql server which I can access via ip address.
Am I doomed?

Thanks

Regards

"Frans Bouma [C# MVP]" <perseus.usenetNOSPAM@xxxxxxxxx> wrote in message
news:OoY5Et$tIHA.3484@xxxxxxxxxxxxxxxxxxxxxxx
John wrote:
Hi

I have an insert sql that inserts selected records from one table into
another. Is there a way to specify in the insert statement that one table
is from one database and the second table is from another database i.e.
insert is between tables of two separate databases?

depends on the database system used. If you use sqlserver, and you have
both catalogs in the same server, you can do:
INSERT INTO [cataloga].[schemaowner].[table] (field1, field2,...)
SELECT field1, field2, ...
FROM [catalogb].[schemaowner].[table]
where...


schemaowner is usuablly 'dbo'

If they're on separate boxes, you can link one server into another server.
You then get yet another name in front of the table name:
..
FROM [server].[catalogb].[schemaowner].[table]...

FB

--
------------------------------------------------------------------------
Lead developer of LLBLGen Pro, the productive O/R mapper for .NET
LLBLGen Pro website: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------


.



Relevant Pages

  • Create SharePoint Portal failed.
    ... One mentioned ensuring that SQL Server uses a case ... 13:55:40 Service database server is 'USDC-JOHRIV'. ... Update dbo.propertylist set DisplayName = N'Last name' ...
    (microsoft.public.sharepoint.portalserver)
  • Re: ADO Connection Timeout
    ... to the central server, but you are willing to live with periods where it ... i.e. a local database or even a text file. ... to function until the connection can be restored to the server. ...
    (microsoft.public.data.ado)
  • Web Developers - Happy Hearts And HDTV! - Lockergnome
    ... Certificate on your MSIIS Web server. ... getting data from a database is only half the problem. ... Zend recently started a series about building rock solid code in PHP. ... which provides bulk database conversion. ...
    (freebsd-questions)
  • Re: TNS could not resolve the connect identifier
    ... This database resides on Machine A. ... The Web server is running on Machine B. ... Using tnsping is not as good as using a real connection such as via ... client (note that this is terminology that appears in the 10g R2 ...
    (comp.databases.oracle.server)
  • Config for OLTP system
    ... extrenal disks fo the 60GByte database server. ... IBM Informix Dynamic Server Configuration Parameters ... # BUFFSIZE - OnLine no longer supports this configuration parameter. ...
    (comp.databases.informix)