Please tell me which is better for the performance impact ?
1. Insert into #temp table Using the cross join with tables.
2. Insert into #temp table using the while loop to repeat the same data no of times.
Even if we told you the correct answer, you shouldn't just take someone's word for something especially in the internet. Setup a test and test it!
I'll also tell you that neither of the two options you have are, depending on what I think you're doing, the absolute fastest. If you were to post one of your solutions for the above so I can see what you're actually doing, then one of us can show you the fastest solution.
is pronounced "ree-bar
" and is a "Modenism
" for R
First step towards the paradigm shift of writing Set Based code:
________Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
"If you think its expensive to hire a professional to do the job, wait until you hire an amateur."--Red Adair
"Change is inevitable... change for the better is not."
When you put the right degree of spin on it, the number 3|8
is also a glyph that describes the nature of a DBAs job. 😉
How to post code problems
Create a Tally Function (fnTally)