This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const RawHTML = ({children, className = ""}) => | |
<div className={className} dangerouslySetInnerHTML={{ __html: children.replace(/\n/g, '<br />')}} /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- With SQL | |
select handle.text as sql, * from | |
( | |
select DB_NAME(dbid) as dbname, * | |
from master.dbo.sysprocesses | |
where blocked <> 0 | |
union |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- Kill blocked processes on a database | |
DECLARE @databasename nvarchar(50) | |
SET @databasename = N'Datbase_Name' | |
-- SET @databasename = DB_NAME() | |
DECLARE @Sql varchar(max) | |
SET @Sql = '' | |
SELECT @Sql = @Sql + 'Kill ' + Convert(varchar, SPId) + ';' | |
FROM master.dbo.sysprocesses |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- https://myadventuresincoding.wordpress.com/2013/05/27/sql-server-check-index-fragmentation-on-all-indexes-in-a-database/ | |
SELECT dbschemas.[name] as 'Schema', | |
dbtables.[name] as 'Table', | |
dbindexes.[name] as 'Index', | |
indexstats.alloc_unit_type_desc, | |
indexstats.avg_fragmentation_in_percent, | |
indexstats.page_count | |
FROM sys.dm_db_index_physical_stats (DB_ID(), NULL, NULL, NULL, NULL) AS indexstats | |
INNER JOIN sys.tables dbtables on dbtables.[object_id] = indexstats.[object_id] | |
INNER JOIN sys.schemas dbschemas on dbtables.[schema_id] = dbschemas.[schema_id] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This contains some steps to start working with RVDB 4.2 | |
1. Download the zip at https://ravendb.net/download | |
2. Unzip to a folder eg D:\Tools\RavenDB\RavenDB-4.2.113-windows-x64 | |
3. Start a PowerShell in Admin mode and change to RVDB folder, execute run.ps1 script | |
4. Go through some simple steps, ignore configuring any server certificate, we can start using RVDB at this address: http://127.0.0.1:8080/studio/index.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
ja.job_id, | |
j.name AS job_name, | |
ja.start_execution_date, | |
ISNULL(last_executed_step_id,0)+1 AS current_executed_step_id, | |
Js.step_name | |
FROM msdb.dbo.sysjobactivity ja | |
LEFT JOIN msdb.dbo.sysjobhistory jh | |
ON ja.job_history_id = jh.instance_id | |
JOIN msdb.dbo.sysjobs j |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare @dbName varchar(255); | |
set @dbName = 'TestDB'; | |
SELECT m.physical_device_name, | |
b.backup_start_date, | |
b.backup_finish_date, | |
b.type, | |
b.backup_size/1024/1024 AS BackupSizeMB, | |
b.compressed_backup_size/1024/1024 as CompressedBackupSizeMB |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- NOTE | |
-- Must update dbName & Folder | |
declare @dbName nvarchar(150); | |
declare @folder nvarchar(100); | |
set @dbName = 'TestDB'; | |
set @folder = 'D:\Mega\Wip\SQL\TestDB\Backup\'; | |
declare @path nvarchar(255); |
NewerOlder