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
 Other SQL Server Topics (2005)
 Can't find out where this insert is happening.....

Author  Topic 

whsbeernuts
Starting Member

11 Posts

Posted - 2007-09-06 : 11:39:47
Hello people, I don't expect anyone to know the answer to this but I guess we'll see huh?

I'm using Microsoft SQL Server Management Studio to do all my SQL stuff, and one of the tools that comes with this is a program called Microsoft SQL Profiler 2005. Anyways, so I'm using this profiler to capture SQL processes in the background while I work with the front end.

Here is a problem I'm facing... I am looking at this table right... and I see that when I do this certain process on the front end, it inserts 3 rows into the table. So I'm thinking "I know that on the tracer, I should be looking for an insert or a Stored Procedure with and insert in it."

So I use the tracer on the front end process and it shows me all the stored procedures that happen during the process of inserting these 3 rows into this table (btw this process is doing other things besides inserting stuff into this table, but it's what i'm currently working with at the moment.)

So what I do here at my job is I take this code, tweak it to work for our front end, and wah lah.... we're good to go. So in saying that, I make my own stored procedure and I all these stored procedures that are happening.

My result......

I get only 2 row inserts into the table.... the 1st row and the last row..... the middle row isn't inserted for some mysterious reason. I tried checking all the stored procedures for unique information pertaining to that specific row insert but to no avail I couldn't.

So my question to you guys is.... is there anything I'm overlooking that could possibly be inserting that row in the table? Thanks guys!

Kristen
Test

22859 Posts

Posted - 2007-09-06 : 11:48:26
Circumstances of the original execution were different, and thus 2 rows got inserted instead of two?

Check the source code for the original Sprocs run, and see what INSERTs they do?

Maybe a Trigger inserted the extra row (which would be harder to find with SQL Profiler )

You could put a trigger [temporarily] on the table, and have it "record" what was inserted, plus the time, which you could then perhaps correlate with the time of the SQL Profiler statements, and work out which Sproc actually caused the insert?

Kristen
Go to Top of Page

whsbeernuts
Starting Member

11 Posts

Posted - 2007-09-06 : 12:07:48
I kind of had my boss somewhat explain to me how to go about doing that process but im afraid im a bit confused.... i've only done SQL for about a month now so I don't know pretty much everything there is to know. I'm gonna try what you said regardless though, and it sounds like it could very well be the answer. Thank you.
Go to Top of Page
   

- Advertisement -