0

I have two similar database with the same schema.But one is for printing purpose. My window form application needs to read data from dby on server1 to dby on server2.The servers are on different network but can communicate. Am trying to use subquery this is
query:

Using main_db
Insert into socio_bio 
select * from socio_bio where receiptno in (
)
3
  • 1
    What database system, and which version?? SQL is just the Structured Query Language - a language used by many database systems, but not a a database product... features like this is often vendor-specific - so we really need to know what database system you're using.... Commented Jul 25, 2012 at 10:02
  • @marc_s, The database system is sqlserver 2008 Commented Jul 25, 2012 at 10:53
  • Thanks - that should be something you always put in your tags to make things clear! Commented Jul 25, 2012 at 10:54

1 Answer 1

2

You can use this stored procedure: sp_addlinkedserver()

exec sp_addlinkedserver @server = 'yourServerName'
select * from [server].[database].[schema].[table]

and in your example

select * from [yourServerName].[testdb].[dbo].[table]
Sign up to request clarification or add additional context in comments.

1 Comment

Delreli, Now understand that i need to create a linkedserver

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.