Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- create function [dbo].[FastCount](@object_id int)
- returns bigint
- as
- begin
- declare @fastcount bigint = 0
- select @fastcount = sum (p.rows)
- from sys.tables as t
- inner join sys.partitions as p on p.object_id = t.object_id
- where p.index_id < 2
- and t.object_id = @object_id
- return @fastcount
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement