Step by step how you can change ‘root’ password You must have rights to stop/start services, and kill process. Step 1: Stop MySql service run: services.msc … Step 2 : Create file to reset password You can use your password and your file name. We use password : Pass1Word2 and file name : C:\temp\reset.txt 1 2USE mysql;...

This code create a table to log all connections. It is very simple, it just logs when, who, from where and which database. For this we use “master.dbo.sysprocesses” https://docs.microsoft.com/en-us/sql/relational-databases/system-compatibility-views/sys-sysprocesses-transact-sql?view=sql-server-2017 Create table to log...

When we write a query than is running for every database in the instance of SQL Server, we use Sp_msforeachdb. If your query is bigger than 2000 chars, the query cannot work because Sp_msforeachdb has a character limitation of 2000 chars. The solution is to re-create MySp_myforeachdb. We use sp_helptext to see the...

This script remedy index fragmentation by reorganizing or rebuilding an index. Small tables, small indexes, low fragmentation, we do not care, and keep simple & easy We are talking about the guidance which is: •if a table has less than 10000 rows, to do nothing •if an index has less than 1000 pages, to do nothing •if...

It just monitor a folder for new files with Powershell. 1 2#My function 3function Do-MonitorNewFile-TODO($Event_name, $Event_FullPath, $Event_changeType, $Event_TimeGenerated) 4{ 5 Write-Host "The file '$Event_name' was $Event_changeType at $Event_TimeGenerated" -ForegroundColor red 6} 7 8function...

We have this great Website about the Stored Procedure : sp_whoisactive - Version 11.30 - December 10, 2017 This version does NOT create a stored procedure, it just run in an ad hoc manner. 1 2-- http://whoisactive.com 3 4SET QUOTED_IDENTIFIER ON; 5SET ANSI_PADDING ON; 6SET CONCAT_NULL_YIELDS_NULL ON; 7SET ANSI_WARNINGS...

Metadata is who you talk to when where for how long how often on what device or way. “Metadata absolutely tells you everything about somebody’s life, if you have enough metadata you don’t really need content…. [It’s] sort of embarrassing how predictable we are as human beings.” They know you rang a phone sex service at...

Préambule# Note : tout est réalisé (sous vos yeux ébahis) dans une VM Virtualbox. Ce n’est pas la peine de commencer à troller. Oui, on essaie de parler libre ici. Mais l’idée est aussi de filer des astuces qui peuvent être utiles à tout le monde. Or, parfois, « tout le monde » a un Windows 10. Et pour plein de raisons...

This is quick way to get a string containing the sql datatype required for a column declaration, a create table, a print variables, or convert data to XML and XML to data, based on temp table and column information. How to use: 1. Create your select statement 2. Define if you use or not prefix - you have prefix to...

SSMS default maximum number of characters displayed in each column is 256. You can change this option on: Option/Query Results/SQL Server/Results to Text but, the maximum value is 8192 characters. This is a solution when you need to print more that 8192 characters: 1use master; 2go 3drop proc if exists sp_Print; 4go...

Maintain database indexes You can just create script or run right now the reindex. Verify the configuration to filter databases or to change the FILLFACTOR. 1 2PRINT '-- ***************************************** --' 3PRINT '-- Reindex all tables' 4PRINT '-- on selected databases' 5PRINT '--...

Create backup operator login 1 2PRINT '-- Create backup operator login' 3 4DECLARE @loginName as NVARCHAR(256) = N'UserDbBackupOperator' 5DECLARE @password as nvarchar(128) = N'MyDbBackupStrongPassword' 6 7DECLARE @sql AS NVARCHAR(MAX) 8If not Exists (select loginname from master.dbo.syslogins where name = @loginName )...

Script to get Linked server list. We have repeated linked server name if it has more than one associated remote login. 1 2SELECT @@SERVERNAME AS 'Server Name' 3, sys.servers.server_id AS 'IdLinkedServer' 4, sys.servers.name AS 'Linked Server Name' 5, CASE sys.servers.Server_id WHEN 0 THEN 'Current Server' 6 ELSE...

Source : http://blog.danskingdom.com/powershell-ise-multiline-comment-and-uncomment-done-right-and-other-ise-gui-must-haves/ Ctrl + K Comment Selected Lines Ctrl + Shift + K Uncomment Selected Lines 1 2# Define our constant variables. 3[string]$NEW_LINE_STRING = "`r`n" 4[string]$COMMENT_STRING = "#" 5 6function...