Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Re: Please Help..


Message #1 by "Drew, Ron" <RDrew@B...> on Thu, 18 Apr 2002 21:15:25 -0400
This should work. And if you only what to create the structure and not
copy the data just add
INSERT INTO [server].[database].[owner].[table]
SELECT column 1,column 2,..etc FROM [table] WHERE 1=3D2



-----Original Message-----
From: lingasamyk@h... [mailto:lingasamyk@h...]
Sent: Thursday, April 18, 2002 6:27 AM
To: ASP Databases
Subject: [asp_databases] Re: Please Help..


Hi,

   From your statement you have used select * into which means it will
try
to create a new table to insert the selected data
   If you try the above statement it will give the following error

The object name '[server].[database].[owner].' contains more than the
maximum number of prefixes. The maximum is 2.

  But the above can be achieved if the target table is alreay there in
the
other server.
 
  So create the table in the target server

  and use the following statement to insert records to the table in the
other server from the table in the current server


Hope this will solve your problem

Regards,
Lingasamy K


> Hi,

I want to select data from a database on one server and insert into
another database on another server.

I made an ADO connection to one database on one server and am trying to
run a query like the following

   Select * into [server].[database].[owner].[table] from
[tableInThisDatabase]


this one doesent work... Please help

But
    Select * from [server].[database].[owner].[sometable]

does work (because I have already executed sp_addlinkedserver)

I would appreciate any help....

Thanks

Regards,
Arundhati
Message #2 by lingasamyk@h... on Thu, 18 Apr 2002 10:27:29
Hi,

   From your statement you have used select * into which means it will try 
to create a new table to insert the selected data
   If you try the above statement it will give the following error 

The object name '[server].[database].[owner].' contains more than the 
maximum number of prefixes. The maximum is 2.

  But the above can be achieved if the target table is alreay there in the 
other server.
  
  So create the table in the target server 

  and use the following statement to insert records to the table in the 
other server from the table in the current server

INSERT INTO [server].[database].[owner].[table]
SELECT column 1,column 2,..etc FROM [table]

Hope this will solve your problem

Regards,
Lingasamy K

 
> Hi,

I want to select data from a database on one server and insert into
another database on another server.

I made an ADO connection to one database on one server and am trying
to run a query like the following

   Select * into [server].[database].[owner].[table] from
[tableInThisDatabase]


this one doesent work... Please help

But
    Select * from [server].[database].[owner].[sometable]

does work (because I have already executed sp_addlinkedserver)

I would appreciate any help....

Thanks

Regards,
Arundhati
Message #3 by Atul Jamdade <atul.jamdade@b...> on Thu, 18 Apr 2002 09:05:51 +0530
create two different connections to the respected databases,open recordsets
for the associated connections  and then transfer data accordingly.

-----Original Message-----
From: Arundhati Bopardikar [mailto:Bopardikar@Q...]
Sent: 17/04/2002 21:40
To: ASP Databases
Subject: [asp_databases] Please Help..


Hi,

I want to select data from a database on one server and insert into
another database on another server.

I made an ADO connection to one database on one server and am trying
to run a query like the following

   Select * into [server].[database].[owner].[table] from
[tableInThisDatabase]


this one doesent work... Please help

But
    Select * from [server].[database].[owner].[sometable]

does work (because I have already executed sp_addlinkedserver)

I would appreciate any help....

Thanks

Regards,
Arundhati

Message #4 by Arundhati Bopardikar <Bopardikar@Q...> on Wed, 17 Apr 2002 09:09:34 -0700
Hi,

I want to select data from a database on one server and insert into
another database on another server.

I made an ADO connection to one database on one server and am trying
to run a query like the following

   Select * into [server].[database].[owner].[table] from
[tableInThisDatabase]


this one doesent work... Please help

But
    Select * from [server].[database].[owner].[sometable]

does work (because I have already executed sp_addlinkedserver)

I would appreciate any help....

Thanks

Regards,
Arundhati

  Return to Index