Easy Index suggestion

DECLARE @DBID INT SELECT @DBID = DB_ID() SELECT OBJECT_NAME([OBJECT_ID]) ‘TABLE NAME’,INDEX_TYPE_DESC ‘INDEX TYPE’,IND.[NAME],CASE WHEN AVG_FRAGMENTATION_IN_PERCENT <30 THEN ‘To Be Re-Organized’ ELSE ‘To Be Rebuilt’ END ‘ACTION TO BE TAKEN’ ,AVG_FRAGMENTATION_IN_PERCENT ‘% FRAGMENTED’ FROM sys.dm_db_index_physical_stats(@DBID, NULL, NULL, NULL, NULL) JOIN sys.sysindexes IND ON (IND.ID =[OBJECT_ID] AND IND.INDID = INDEX_ID) WHERE AVG_FRAGMENTATION_IN_PERCENT > 0 AND DATABASE_ID = […]

eventv

Who altered the user roles

Hi Folks If you want to trace out who have alter the user roles in the SQL Server.here is the simplest way. Open SQL Server management studio and execute the below query select * from sys.traces Copy the output of sys.traces and replace it in the query path of below query SELECT TextData,StartTime,NTUserName,ApplicationName FROM fn_trace_gettable(‘C:Program […]