Friday, February 24, 2012

communicate between two servers

I have two sql servers, A and B. each one has one database, A and B. I am trying to write a stored porcedure in database A to retrieve the data in database B. how do I do it? can you give me a simple example. (like "select")Check Books on Line for info on Linked Servers. Set that up and then you use the fully qualified names

From server A:

select field1, field2 from serverb.databasename.ownername.tablename
where ...|||When I use
servera.database...... in server A it works
but when I use
serverb.database...... in server A it doesnt work.|||what's the error message?

it's supposed to be.. [ [ [ server. ] [ database ] . ] [ owner_name ] . ] object_name|||first, I link two servers. then I run a select in view.
the error msg is
"Access to the remote server is denied because no login-mapping exists"
how do I do?|||It's BOL on how to do it. Linking the servers opens a channel between them. You have to map logins so that you then have the proper access. Basically, you say "If I'm logged in as Joe on server A, when I connect to server B from server A, I want to act like server B's user named Fred." Right click the linked server, Properties, Security tab.

No comments:

Post a Comment