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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 inserting from one db into another

Author  Topic 

mtcoder
Starting Member

19 Posts

Posted - 2011-09-06 : 14:03:55
I am trying to grab data from one sql server and insert it into another. I have already done the sp_addlinkedserver, and sp_addlinkedsrvlogin successfully. When I run my insert statement though I get.
Login failed for user 'NT Authority\Anonymous Logon.

Which to me means the statement isn't using the account setup in sp_addlinkedsrvlogin. who do I tell the insert statement to use that account? Or what else is wrong?
Thanks

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-09-06 : 14:37:03
You'd need to keep Kerberos all setup, which isn't an easy task. Instead, we always add our SQL credentials in the linked server properties. Once you do that, you just need to login with your SQL account and then the linked server will work.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

mtcoder
Starting Member

19 Posts

Posted - 2011-09-06 : 16:03:44
if I don't setup the security credentials I can get it to work by having it default to using the logins current security context. My only concern, will be when I try and use my web page to preform the same tasks. If I setup any credentials the thing starts bombing out on me left and right. Probably just need to play around with it a bit more, but it's hard to find a good guide on how to configure it all. Google and bing are failing me today. lol
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-09-06 : 16:12:29
I mistyped when I said we always put our SQL credentials in there. We actually always select "current security context" and then login with sa. We only type in SQL credentials into the linked server when we need someone else's permissions to apply.

Sorry for the misinformation earlier.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

mtcoder
Starting Member

19 Posts

Posted - 2011-09-07 : 08:03:04
let me restate that for clarity, if I setup login mapping it doesn't work. Didn't want to confuse it with credentials.

Also my main concern is while I get to play with SA accounts my website is not as fortunate. It gets a basic read, write access, to protect everything.
Go to Top of Page
   

- Advertisement -