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

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
LVL 1
CubicleGuyAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

lofCommented:
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
lofCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
CubicleGuyAuthor Commented:
Linked servers are new to me -- but after reading the URL, it seems to be the answer.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server 2005

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.