Showing posts from May, 2009

table partition

-Creating CREATE PARTITION FUNCTION IdPartition ( int ) AS RANGE RIGHT FOR VALUES ( 10000 , 20000 , 30000, 40000, 50000 ) CREATE PARTITION SCHEME IdSchema AS PARTITION IdPartition TO ( Filegroup1,Filegroup2,Filegroup3,Filegroup4,Filegroup5,Filegroup6) Altering ALTER PARTITION SCHEME IdSchema NEXT USED Filegroup2 ALTER PARTITION FUNCTION IdPartition () SPLIT RANGE ( 100000 ) retrieving partition status of databases SELECT $partition.IdPartition(DCEProjects.ID) AS [Partition Number],max(DCEProjects.ID) FROM dbo.DCEProjects --WHERE $partition.IdPartition(DCEProjects.ID) = 2 GROUP BY $partition.IdPartition(DCEProjects.ID) ORDER BY [Partition Number]

Get all Tables rows count in a database

Here is T-SQL Statment; Select 'TabloAdi_TableName' , B.rowcnt 'SatirSayisi_RowCount' from sysobjects A, sysindexes B where and A.type = 'u' and indid <2 order by TableName good luck,

comparision executed user role with given

Syntax : is_srvrolemember(SQLServerRole in String) Returns : if user has right for given return will be 1 for example; if (not (is_srvrolemember('sysadmin') = 1)) -- Make sure that executing by SQ. begin raiserror(...) return(1) end