September 28, 2009 at 7:42 am
Thanks for the offer... I read about the "With" Statement... I like it ... Very nice and powerful
Thank You
September 28, 2009 at 7:53 am
Yes, and for information purposes, those "With" clauses are also called CTE's or 'Common Table Expressions'. It is nice though I have not used it yet. Waiting for a situation where I will need it.
--
:hehe:
October 16, 2009 at 4:45 am
Lowell (9/25/2009)
Stuff
It's important to mention that all %% pseudo-columns are undocumented, unsupported, and very cool.
February 3, 2010 at 5:03 am
Good Work Lowell
100 out of 100
Leena
February 3, 2010 at 9:09 am
glad this was helpful for you , Leena; I've never found a practical use for it so far, but it is good to know; of course there is always more than one way to do this, and I usually use row_number() , but it's fun to expand the toolbox of scripts a little bit.
nandy.chawala (2/3/2010)
Good Work Lowell100 out of 100
Leena
Lowell
February 4, 2010 at 12:04 am
Lowell (2/3/2010)
I've never found a practical use for it so far...
Probably just as well since it is undocumented 😉
I think I used it once to demonstrate lock hash collisions (two rows that generated the same lock hash and hence could deadlock, even though the data rows themselves were unrelated).
I might be misremembering it though 😛
2008 has %%PhysLoc%% and an undocumented decoding function to go with it. See http://www.sqlskills.com/BLOGS/PAUL/post/SQL-Server-2008-New-(undocumented)-physical-row-locator-function.aspx
Paul
February 5, 2010 at 1:41 am
Less sophisticated but what also would work (ans also on sql 2000):
select col1, col2, col3, col4 from Mytable into #tmp_Mytable
group by col1, col2, col3, col4
truncate table Mytable
insert into Mytable select * from #tmp_table
Large tables would require a lot of column typing though.
February 5, 2010 at 1:51 am
d.majoor (2/5/2010)
Large tables would require a lot of column typing though.
You could use SELECT DISTINCT * to overcome that (instead of using the group by).
February 9, 2010 at 5:07 pm
NVM. I just saw someone suggested the same solution I did 🙂
Viewing 9 posts - 16 through 23 (of 23 total)
You must be logged in to reply to this topic. Login to reply