Posts

Showing posts from December, 2020

Sleep command for Windows

 I came across a situation where my Home system which is Windows 10 Pro not able to go to sleep mode and my CPU is always up and running, I have gone through a couple of blogs, documents and also google a couple of articles some says due to Network Adapters, In my system, all the network adapters( ncpa.cpl ) are in the disabled state though my system is always awake not going to sleep mode. After a couple of hours research i found this command which fulfilled my requirement. powercfg/requestsoverride driver srvnet system" 

Index information on a particular database.

I have gotten into a situation where one of the index page got corrupted in one of the databases. Regarding corruption we come to know when run DBCC CHECKDB command and it thrown an error message like below. Msg 8936, Level 16, State 1, Line 3 Table error: Object ID 1701581100, index ID 1, partition ID 72057594048479232, alloc unit ID 72057594058964992 (type In-row data). B-tree chain linkage mismatch. (1:1209224)->next = (1:1081), but (1:1081)->Prev = (1:1080). Search here with the below query by adding ObjectID(above) to the query USE DatabaseNameHere GO SELECT * FROM sys.indexes where object_id = '123456' This query will also bring information about Primary Key indexes. USE DatabaseNameHere GO select s.name, t.name, i.name, c .name from sys.tables t inner join sys.schemas s on t.schema_id = s.schema_id inner join sys.indexes i on i.object_id = t.object_id inner join sys.index_columns ic on ic.object_id = t.object_id inner join sys.co

Granting Permissions to Create Function

 By using the below code we can GRANT permission to create a function to a particular user use [AdventureWorks2012] GO GRANT CREATE FUNCTION TO [bhavya] GRANT ALTER ON SCHEMA ::dbo TO [bhavya]