Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 insert data from server to local db

Author  Topic 

aakcse
Aged Yak Warrior

570 Posts

Posted - 2009-09-10 : 03:20:29
Hello all,

I want to insert data from ( say 1.1.1.1 server) to my local db
I am able to connect to 1.1.1.1 server db from my local machine
database engine.

I want to create the table structure along with data in my local db from server, How can i do this.

select * into dbo.tablename from 1.1.1.1.dbo.serverdb.tablename

some thing like above.

Regards,
cse

senthil_nagore
Master Smack Fu Yak Hacker

1007 Posts

Posted - 2009-09-10 : 03:28:22
Read about Linked Server in BOL.

Senthil.C
------------------------------------------------------
[Microsoft][ODBC SQL Server Driver]Operation canceled

http://senthilnagore.blogspot.com/
Go to Top of Page

aakcse
Aged Yak Warrior

570 Posts

Posted - 2009-09-10 : 04:51:56

Thanks Senthil, I am looking to linked server

will the below format works, I can try this
however I am not able understand, where I need to place the ip address of the server from which
I need to get the data.


Select * from openquery('','select * from
DBNAME.Table_owner.Table_Name')
Go to Top of Page

senthil_nagore
Master Smack Fu Yak Hacker

1007 Posts

Posted - 2009-09-10 : 05:11:04
Add the linked server, and try as in your previous post!

Senthil.C
------------------------------------------------------
[Microsoft][ODBC SQL Server Driver]Operation canceled

http://senthilnagore.blogspot.com/
Go to Top of Page

aakcse
Aged Yak Warrior

570 Posts

Posted - 2009-09-10 : 05:38:57
can you plz help me with the syntax, if I have the below query to execute

select * into dbo.tablename from 1.1.1.1.dbo.serverdb.tablename
Go to Top of Page

aakcse
Aged Yak Warrior

570 Posts

Posted - 2009-09-10 : 05:43:30
I think first I need to add the server using sp_addlinkedserver
can you plz help me how can I add the server ?
Go to Top of Page

senthil_nagore
Master Smack Fu Yak Hacker

1007 Posts

Posted - 2009-09-10 : 05:47:20
Try this..

http://social.msdn.microsoft.com/Forums/en-US/sqlsecurity/thread/b3ff9cf9-c023-4ffc-8dd7-fba9644be441

http://knol.google.com/k/jeyong-park/add-sql-server-65-linked-server-in-sql/3vywlm4f31xae/6#


Senthil.C
------------------------------------------------------
[Microsoft][ODBC SQL Server Driver]Operation canceled

http://senthilnagore.blogspot.com/
Go to Top of Page
   

- Advertisement -