How to detect duplicates in my SQL Server database and not create another record.
Posted on 2011-03-01
Hello Experts, if this can be done, then this is the place to ask this question. Okay here's my situation. I have created an app that captures all the pertinent information that we need to process our clients licensing needs. By the way, we're an insurance licensing company. So, here's where things are messing up on me. For whatever reason, we are getting duplicates in our database. Now, we have some clients that call in and tell us that a certain page is not acting right for whatever reason. I can't for the life of me figure out what is going on with my app. I have filled this thing out from anywhere to a dial-up connection to a wireless connection and it ALWAYS works good for me. And from different locations, still, no problems for me. But, so they say, it's messing up on them. I don't know if there are memory leaks, I don't know, it's driving me crazy, anyway, so this is how I built the application. It's basically several "pages" and so at the bottom of each page there is a button that says "Next Page" and when the clients click that button it dumps their information from that page into a database table built for that page only. Now, I was wondering, is there a way to, I guess, like poll the database if the app messes up on them to see of their data is already there? And then if their data does exist, to NOT do a database insert a second time, but just go ahead and move them to the next page? It's really filling up my little database that I built for this, and I keep having to fire up SQL Enterprise Manager and delete the duplicates.
I already added jQuery BlockUI with a neat little "Processing data...Please wait." message to kind of slow them down a little so they won't get so impatient while waiting to move to the next page. I don't know what else to do, I have tested this thing to the hilt and I like I said, I cannot figure out what is going on. I just know I'm tired of duplicates. Also, just for the record, I'm not using any kind of Ajax or ASP.Net Ajax or anything, don't know if that matters or not.
If any of you have had this problem and came up with a solution, I would really, really appreciate it if you could pitch me a solution.
Oh one more thing, I am creating a unique userid on the first page and passing it encrypted through the query string to the next page, and then the next page, and so on like that, and it gets dumped to the database as well.