Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1027083
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T12:11:08+00:00 2026-05-16T12:11:08+00:00

I am not sure if the transaction log is what I need or what.

  • 0

I am not sure if the transaction log is what I need or what.

My first problem is that I have a stored procedure that inserts some rows. I was just checking out elmah and I see that some sql exceptions happens. They all are the same error(a PK constraint was violated).

Other than that elmah is not telling me much more. So I don’t know what row caused this primary key constraint(I am guessing the same row was for some reason being added twice).

So I am not sure if the the transaction log would tell me what happened and what data was trying to be inserted. I can’t recreate this error it always works for me.

My second problem is for some reason when my page loads up I have a row from that database that I don’t think exists anymore(I have a hidden column with the PK in it.) When I try to find this primary key it does not exist in the database.

I am using ms sql 2005.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T12:11:09+00:00Added an answer on May 16, 2026 at 12:11 pm

    I don’t think transaction log will help you.

    SQL 2 modes on how to insert data with uniqueness violation.
    There is a setting : IGNORE_DUP_KEY. By default it is OFF. IF you turn it ON, SQL will ignire duplicate rows and your INSERT statement will succeed.

    You can read about it here:
    http://msdn.microsoft.com/en-us/library/ms175132.aspx

    BTW, to view transaction log, you can use this command:

    SELECT * FROM  fn_dblog(null, null)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just made a transaction go through but not sure where there is a
I have the following code which is in a transaction. I'm not sure where/when
I have a 5GB database and a 20GB transaction log (SQL Server 2005). Not
Here's my scenario: I have a simple stored procedure that removes a specific set
I have a database that has a 28gig transaction log file. Recovery mode is
Not sure if im just being stupid or something but here goes i work
Not sure how to ask this, but i'll give it a try: I have
I am doing a cross-site ajax to java data transaction(Not sure if I named
I have realized I am missing something obvious. Not sure what it is, Hoping
I'm not sure what a good way to manage this transaction in code would

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.