Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Pulling from a MSSQL 2005 db on a remote server and inserting results into our MSSQL 2005 tables

Posted on 2010-01-11
3
Medium Priority
?
319 Views
Last Modified: 2012-05-08
I'd prefer to *not* use MS Business Integration Studio.

Can I, in one stored procedure, pull data from table A in database A and then insert the results into table B in database B?

Is it as simple as using "USE" to identify the source and then the target?

Thanks
0
Comment
Question by:CubicleGuy
  • 2
3 Comments
 
LVL 10

Expert Comment

by:lof
ID: 26287132
If databases are on the same server it is as simple as using longer names of the tables

databaseA.schema.tableA
databaseB.schema.tableB

default schema is dbo.

if the database are on different servers you will need to use linked servers
0
 
LVL 10

Accepted Solution

by:
lof earned 500 total points
ID: 26287975
I have just read the title again. You say about using remote server but then in the question you ask about using simple USE.

If it is remote server than use linked servers http://msdn.microsoft.com/en-us/library/aa213778(SQL.80).aspx 

and than four part name

linkedserver.database.schema.table

if the databases are on the same instance all you need is three part name

database.schema.table
0
 
LVL 1

Author Closing Comment

by:CubicleGuy
ID: 31675715
Linked servers are new to me -- but after reading the URL, it seems to be the answer.
0

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

by Mark Wills Attending one of Rob Farley's seminars the other day, I heard the phrase "The Accidental DBA" and fell in love with it. It got me thinking about the plight of the newcomer to SQL Server...  So if you are the accidental DBA, or, simp…
INTRODUCTION: While tying your database objects into builds and your enterprise source control system takes a third-party product (like Visual Studio Database Edition or Red-Gate's SQL Source Control), you can achieve some protection using a sing…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Enter Foreign and Special Characters Enter characters you can't find on a keyboard using its ASCII code ... and learn how to make a handy reference for yourself using Excel ~ Use these codes in any Windows application! ... whether it is a Micr…

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question