Getting Started with Adobe After Effects - Part 6: Motion Blur


Upload Image Close it
Select File

My Experiments with SQLServer
Browse by Tags · View All
SQLServer 126
SQLServer 2008 R2 91
SQLServer 2008 86
SQLServer 2005 82
SQL 60
Database 59
Sql And Me 57
Tips & Tricks 28
SQL Server 27
SQL FAQ 26

Archive · View All
May 2011 25
June 2011 21
July 2011 21
August 2011 19
April 2011 16
January 2013 4
May 2012 3
April 2012 3
October 2011 3
February 2013 2

Vishal Gajjar's Blog

Using Built-in System Function – $PARTITION

May 23 2011 7:10AM by Vishal Gajjar   

you can use @PARTITION TSQL function to check which partition will be mapped to a specified column value.

For example if you have a partition function with four partitions as below:

-- © 2011 – Vishal (http://SqlAndMe.com)
 
CREATE PARTITION FUNCTION PartFunc01 (INT)
AS RANGE FOR VALUES (10, 20, 50)

Now, when you insert data to a table which uses a partition scheme which is based on this partition function, the data will be inserted according to partition number returned by the partition function.

If you need to check which partition does a column value belongs to, you can use $PARTITION function as below:

SELECT      $PARTITION.PartFunc01 (9),
            $PARTITION.PartFunc01 (11),
            $PARTITION.PartFunc01 (21),
            $PARTITION.PartFunc01 (51)

Result Set:

———– ———– ———– ———–
1           2           3           4
 
(1 row(s) affected)

It can also be used in a WHERE clause:

-- © 2011 – Vishal (http://SqlAndMe.com)
 
SELECT      ID, Name
FROM  dbo.FirstNames
WHERE $PARTITION.PartFunc01(ID) = 2
-- Where 2 is the partition number

Hope This Helps! Cheers!


Republished from Sql&Me [31 clicks].  Read the original version here [32134 clicks].

Vishal Gajjar
46 · 4% · 1276
0
Liked
 
0
Lifesaver
 
0
Refreshed
 
0
Learned
 
0
Incorrect



Submit

Your Comment


Sign Up or Login to post a comment.

    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]