Quantcast
Channel: SQL Server Database Engine forum
Viewing all articles
Browse latest Browse all 12554

create index causes insert statements?

$
0
0

I decided to create an index on an existing table with a million rows.

I give a simple command like "create index idx_mytable_myfield on mytable(myfield);"

It so happens I have profiler running on that system with rpc completed and SP statement completed events, and TSQL batch completed event.

I see my create statement go by as a batch completed, fine.

But above it I see it also caused an SP statement completed event that says:

"insert [dbo].[mytable] select * from [dbo].[mytable] option (maxdop 1)"

Hey I didn't even know I was calling an SP, but looking at that syntax it claims to have executed ... huh?

Thanks,

Josh


Viewing all articles
Browse latest Browse all 12554

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>