September 2, 2010 at 5:52 am
simflex-897410 (9/1/2010)
I have a quick question Wayne.Why didn't I just do that for only name since that's the only one we are interested in displaying first value only while leaving the rest blank?
The issue is that when getting a value from a previous row to use in this row, that you have to guarantee the order that things will be process. That's why you need a clustered index (puts the physical table into an order), an update without a where clause (so the whole table will be processed), an "anchor" column (get the first column from the clustered index into a variable as a 2-part operation), the TABLOCKX table hint (to prevent any other process from accessing the data while you're doing this), and the MAXDOP 1 option (to prevent any parallelism). Not doing any of these (and a few other rules) will cause things to NOT be processed in the proper order. Result = bad data.
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
September 2, 2010 at 6:13 am
Thank you very, very much Wayne for your help.
Viewing 2 posts - 16 through 16 (of 16 total)
You must be logged in to reply to this topic. Login to reply