I figured out my problem. Because I'm using tablea to help me determine which records needed to be inserted, I was getting multiple records for the id, thus causing the duplicate error. What I needed to do was add the DISTINCT keyword in my select statement to avoid this problem.
Thanks for...
Thanks so much for your reply. I need tablea because that tells me which of the deleted records to insert back into the original table. I don't want to insert them all back in.
Any thoughts on why I'm getting the PK violation when I'm verifying that the records don't exist?
Thanks!
I just archived and deleted a bunch of records and there was a very important piece of my code commented out that caused me to delete too many records. Fortunately I archived them, but I'm trying to insert them back into the table, but I get this message:
Violation of PRIMARY KEY constraint...
The 2 servers are in the same domain. My user is added in both servers. (I can run this fine logged in as me from the SQL Server, but not from my machine, so I was thinking that the issue couldn't be related to my account.)
Thanks again,
CJ
Hi, Denis.
Thanks for your post. I checked and unfortunately it is already mixed authentication. I was hoping it would be so easy! Any other ideas?
Thanks!
CJ
On one of my SQL Server installations I have a linked server defined. I have created a stored proc that queries the linked server. If I log into the server as me (I'm an administrator) and use Query Analyzer to run the SP, it runs fine. If I am using QA from my own PC, I get: Login failed for...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.