Category: Database

How To Link Containers Using Docker Compose

This yields several advantages:1. Direct linking between containers is architectually efficient to direct traffic between…

How To Recover SQLSERVER Service from Being Unable to Start

# startSqlService.ps1 # special provision to deal with SQL Server not starting up due to…

PowerShell: Automatically Fix SQL Server by Killing Long Running Queries

# autofixSqlLongRunningQueries.ps1 # version 0.01 # This version is limited to SQL Server Localhost execution,…

T-SQL: Ad-hoc Commands to Backup All Databases

-- turn on Windows cmd shell EXEC sp_configure 'show advanced options', 1; GO RECONFIGURE; GO…

Microsoft SQL Server Connection Timeout

Error Message: Resolution: a. Check SQL Server's Query Execution Timeout: SSMS > Login > Tools…

Microsoft SQL Server Replication Setup Error Number MSSQL_REPL2110 and Resolution

Symptom: The distribution agent failed to create temporary files in 'C:\Program Files\Microsoft SQL Server\130\COM' directory…

SQL: Truncate Transaction Logs

Overview: Significance: many small teams lack Database Admin resource to babysit SQL databases; therefore, certain…

T-SQL: How To Rename Database in Microsoft SQL Server

The T-SQL USE master; GO ALTER DATABASE TEST_MSCRM SET SINGLE_USER WITH ROLLBACK IMMEDIATE; GO ALTER…

PowerShell: Detect Microsoft SQL Version and Installed Location

function getSqlInfo{ $results=@() $instances=(get-itemproperty 'HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server').InstalledInstances foreach ($i in $instances){ $p=(Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\Instance…

PowerShell: Get SQL Job History

$computername='sql01' function getSqlJobHistory($sqlServerName){ try{ if(!(get-module SqlServer)){ Install-Module -Name SqlServer } Import-Module -Name SqlServer $sqlServerInstance=Get-SqlInstance -ServerInstance…

PowerShell: Get SQL Server Backup Statuses

$computername='sql01' function getSqlBackupInfo ($sqlInstanceName=$env:computername, $dbName){ [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.Smo") $location=if($sqlInstanceName.Contains("`\")){ "SQLSERVER:\SQL\$sqlInstanceName\Databases" }else{ "SQLSERVER:\SQL\$sqlInstanceName\DEFAULT\Databases" } function getPacificTime($time){ if($time){ [System.TimeZoneInfo]::ConvertTimeBySystemTimeZoneId($time,'Pacific…

Use PowerShell to Set Microsoft SQL Database Owner

$owner='CAP\SQL Admins' $databaseName='TestDb' $sqlServer=$env:computername function setDbOwner{ param( $principle=$env:USERDOMAIN+'\Domain Admins', $databaseName='TestDB', $sqlServer ) function includeSqlTools{ $ErrorActionPreference='stop'…

Use PowerShell to Grant SysAdmin Role to Certain Users

$principle=$env:USERDOMAIN+'\Domain Admins' $sqlServer=$env:computername function includeSqlTools{ $ErrorActionPreference='stop' try{ $trustedPsgallery=(Get-PSRepository PSGallery).InstallationPolicy -eq 'Trusted' if(!$trustedPsgallery){ Set-PSRepository -Name PSGallery…

ODBC Driver 32-bit & 64-bit

The 32-bit version: Run: odbcad32.exe > check the list of installed 32-bit drivers as illustrated…

How To Move WordPress Site To Kubernetes Cluster

a. Create backups of source files and database - Logon to Current Hosting Provider to…

Microsoft SQL: Login failed for user ‘sa’. (.Net SqlClient Data Provider)

Error: ===================================Cannot connect to SQL-SERVER===================================Login failed for user 'sa'. (.Net SqlClient Data Provider) Resolution: 1.…

How to Get Table Sizes of a Database in Microsoft SQL Server

Obtain Table Sizes of One or Multiple Names -- Get sizes of multiple tables use…

Microsoft SQL Server: How to Use T SQL to Move Transaction Log Files

Automated Script: # moveDbStorage.ps1 # Version 0.0.1 # This version is intended for a local…

Microsoft SQL: Shrink vs Truncate

Shrink The shrink command is to reduce the physical log file size of a database.…

Microsoft Dynamics 365: System Administrator Profile Corruption Problem

Symptoms: Field Security Profile Does Not List Enabled Custom Fields Certain forms would show a…