SQL Server Blogs


-> Disaster Recovery Using AlwaysON Availability Group – Scenario 1
-> Disaster Recovery Using AlwaysON Availability Group – Scenario 2
-> Configuring Read Only Routing List for AlwaysON Availability Group
-> Reporting Services using AlwaysON Availability Group
-> Difference between Readable Secondary setting Yes and Read Intent only
-> Moving all Availability Groups in the Event of a Single Availability Group Failover
-> AlwaysON – Login Synchronization across Replicas
-> AlwaysON – Working through Crashed Synchronous Secondary Replica
-> Creating Linked Server to a Multi-Subnet Availability Group Listener with ReadOnly routing
-> AlwaysON – How to disable Read-Only routing for an Availability Group
-> AlwaysON – Unable to access the ‘JB1’ database because no online secondary replicas are enabled for read-only access. (Microsoft SQL Server, Error: 982)
-> None of the IP addresses configured for the availability group listener can be hosted by the server ””
-> Always ON Availability group automatic failover to a particular node
-> Listener entry in sys.availability_group_listeners exists even after related Availability group is deleted
-> Finding Transaction latency in an Always on Synchronous replica
-> Application Timeout with Multi-subnet Always On Availability Group
-> Adding Transparent Data Encryption (TDE) Enabled User Database to Always On Availability Group
-> Database Backup and Maintenance job to use secondary replica on a SQL Instance with Always On Availability group
-> Availability Group – SQL Server Agent Job to run only on Always On Primary Replica
-> Script to get Always On Availability group failover time from SQL Server Error log
-> Generating Cluster.log for troubleshooting Always On Availability group failover
-> Always On – Event ID: 1135 – Cluster node ‘Node’ was removed from the active failover cluster membership
-> Designing High Availability and Disaster Recovery using SQL Server Standard Edition
-> Always On – Availability group not failing over automatically
-> Database Mirroring login attempt failed with error: ‘Connection handshake failed. An OS call failed: (8009030c) 0x8009030c.
-> Always ON – Availability group database is “Not Synchronizing”
-> Always ON – Failed to join database to Availability group
> A connection timeout has occurred while attempting to establish a connection to availability replica ‘Node3’ with id [322C3054-0352-4F45-A2C2-9328C354051F]. Either a networking or firewall issue exists, or the endpoint address provided for the replica is not the database mirroring endpoint of the host server instance.
-> Always ON Availability group in RESOLVING state
-> Always ON – The connection to the primary replica is not active. The command cannot be processed. (Microsoft SQL Server, Error: 35250)
-> Always ON – Growing LOG SEND QUEUE on Asynchronous replica
-> Please create a master key in the database or open the master key in the session before performing this operation.
-> Cannot open database ‘JBDB’ version 869. Upgrade the database to the latest version. (Microsoft SQL Server, Error: 946)
-> Replicated transactions are waiting for next Log backup or for mirroring partner to catch up
-> Always ON – Restoring Transaction Log backups to a lagging Always ON Secondary Replica
-> Always On Latency Report
-> Always On – SQL Server hosting availability group ‘JBAG’ did not receive a process event signal from the Windows Server Failover Cluster within the lease timeout period
-> Always On Availability Groups connection with secondary database terminated for primary database ‘JBREPL_SUB’ on the availability replica ‘JBSUB-DR’ with Replica ID: {6a9d0674-6dec-4810-b731-c9cde79cc62d}. This is an informational message only. No user action is required.
-> Always On – Modify Availability group Endpoint URL
-> This secondary replica is not connected to the primary replica. The connected state is DISCONNECTED
-> CREATE FILE encountered operating system error 3(The system cannot find the path specified.) while attempting to open or create the physical file ‘C:\SQL\JBDB1.ndf’
> DNS lookup failed with error: ‘11001(No such host is known.)’.
-> Always On Secondary Database in “Reverting \ In Recovery” state
-> Always On – One or more databases are not synchronized or have not joined the availability group. If the availability replica uses the asynchronous-commit mode, consider performing a forced manual failover (with possible data loss).
-> Always On: WSFC AG integrity check failed for AG ‘JBAG’ with error 41044, severity 16, state 1
-> The connection to the primary replica is not active. The command cannot be processed. (Microsoft SQL Server, Error: 35250)
-> The local availability replica of availability group ‘JBAG’ cannot accept signal ‘UNJOIN_DB’ in its current replica role
-> Zero RPO with Microsoft SQL Server
-> The target database (‘JBDB’) is in an availability group and is currently accessible for connections when the application intent is set to read only
-> Read-Only Select Queries Getting Blocked on Always On Secondary Database by REDO thread
-> Troubleshooting REDO queue or Recovery queue build-up on Always On Readable Secondary Replica due to Blocked REDO thread
-> Select Query on Secondary Replica getting blocked with wait type HADR_DATABASE_WAIT_FOR_TRANSITION_TO_VERSIONING

AlwaysON + Log Shipping

-> Configuring Log Shipping with AlwaysOn
->Error: The specified agent_id 1D58DD23-142C-498F-83AB-5077791B5781 or agent_type 1 do not form a valid pair for log shipping monitoring processing
-> Removing Log shipping on a database with AlwaysOn configured


-> Creating a SQL database in Microsoft Azure portal
-> Restore on-Premise SQL server database to Azure SQL Database
-> Backup On-Premise SQL Server Database to Microsoft Azure
-> Why 4 Core is better than 1 Core IaaS Virtual machine with SQL Server in Azure
-> You must change your password before logging on the first time. Please update your password or contact your system administrator or technical support.
-> There is an active shared access signature outstanding for disk
-> Azure SQL database – Reset administrator password
-> Azure SQL Managed Instance, Azure database Health Check using Azure SQL Analytics
-> SQL Server IaaS Agent extension
-> Integrate Azure Active Directory with Active Directory in Azure Virtual Machine
-> Create a login in Azure Virtual Machine Active Directory and Sync it to Azure Active Directory
-> Connecting Azure SQL Database using Azure Active Directory – Password / Azure Active Directory – Universal with MFA
-> Login to Azure Virtual machine using Azure Active Directory credentials
-> SQL SERVER IAAS AGENT EXTENSION – “Security” tab not populated correctly
-> Connect to SQL Server with PowerShell and Azure key Vault
-> Start and Stop Azure Virtual Machine

Azure Managed Instance

-> My first Azure Managed instance
-> Connecting to Azure Managed instance from a virtual machine
-> Checking SQL Server errorlog in Azure Managed Instance
-> Trace Flags enabled in Azure Managed Instance
-> Is Trace Flag 1117 enabled in Azure Managed Instance?
-> Restore a database backup to an Azure Managed Instance
-> Physical_database_name column in sys.databases
-> Sp_configure on Managed instance
-> GETDATE() on Managed Instance
> Configure Transactional replication between two Azure SQL Managed Instances
-> Transactional Replication – Failed to connect to Azure Storage ” with OS error: 55
-> The process could not connect to Subscriber
-> Database backup on an Azure SQL Managed Instance
-> Restore a Copy_Only backup taken in an Azure SQL Managed Instance onto another Azure SQL Managed Instance
-> Enabling Transparent data encryption using Customer-managed key on Azure SQL Managed Instances that are part of failover group
-> Creating a Linked Server in Azure SQL Managed Instance to Azure SQL Database

Azure SQL Database

-> The database ‘jbswiki’ has reached its size quota. Partition or delete data, drop indexes, or consult the documentation for possible resolutions.
-> The operation cannot be performed since the database ‘JBDB’ is in a replication relationship. (Microsoft SQL Server, Error: 40680)

Azure Synapse Analytics

-> Restore dedicated SQL pools in Azure Synapse Analytics
-> Drop dedicated SQL pools in Azure Synapse Analytics


-> Hide Instance set to YES in SQL server Network Configuration
-> Server TCP provider failed to listen on [1519]. Tcp port is already in use.
-> Using certificates with SQL server
-> Logshipping metadata table log_shipping_monitor_secondary is not getting updated
-> Restore Database – Property BackupDirectory is not available for Settings ‘Microsoft.SqlServer.Management.Smo.Settings’
-> RESTORE detected an error on page (0:0) in database “Database” as read from the backup set.
-> Error: 18456, Severity: 14, State: 5. Login failed for user ‘NT AUTHORITY\ANONYMOUS LOGON’. Reason: Could not find a login matching the name provided.
-> MYSQL Linked server in SQL Server
-> Removing IAM page %S_PGID failed because someone else is using the object that this IAM page belongs to
-> A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 – Error Locating Server/Instance Specified)
-> Resizing SQL Server Database from single data file to multiple Data file
-> Rule “Valid DSN” and Rule “Valid Database compatibility level and successful connection” failed.
-> A transport-level error has occurred when receiving results from the server
-> Log Shipping – Copy and Restore job failing with no error message
-> Restore database backup that contains column encrypted objects
-> Reason: Server is in single user mode. Only one administrator can connect at this time.
-> SQL Server Configuration Manager missing
-> Error: 17204, Severity: 16, State: 1 – FCB::Open failed: Could not open file for file number 2. OS error: 3(The system cannot find the path specified.)
-> Dedicated Admin Connection (DAC) – The Good Samaritan


-> SQL Server Database Corruption – File Header Page Corruption
-> Database Corruption – Repairing a SQL Server database without LDF or Log file


-> Restoring a Transparent Data Encryption (TDE) Enabled User Database on a SQL Server Instance with a different master key
-> Remove Transparent Data Encryption (TDE)


-> SQL Server 2019 on Ubuntu Linux
-> SQL Server 2019 on Redhat Linux
-> SQL Server 2019 on Linux Containers


-> SQL Server Query Optimization – Introduction
-> SQL Server Parameter Sniffing
-> Install and Configure PSSDIAG
-> Install and Configure SQLNexus
-> Trace Flag 7471
-> Tempdb contention
-> Optimize for ad hoc workloads
-> Column data may be deleted when you update another variable-length column in a table of a database upgraded from SQL Server 2005
-> Why Bookmark Lookup is BAD?

-> Optimizing Queries using XML in SQL Server
-> Slow query performance with Table Spool operator


-> Power BI – Could not find file ‘C:\temp\AdventureWorks_Territories.csv’.
-> Power BI – Change data source dynamically when opening Power BI report
-> Power BI – Value should be a Currency
-> Power BI – The key didn’t match any rows in the table

-> Cannot insert an explicit value into a timestamp column. Use INSERT with a column list to exclude the timestamp column, or insert a DEFAULT into the timestamp column.
-> Finding Undistributed commands in Transactional replication
-> Exception Message: The snapshot could not be generated because the publisher is inactive
-> Agent message code 21021. The subscription does not exist.
-> Configuring Transactional replication using Initialize from LSN
-> Cannot execute as the database principal because the principal “dbo” does not exist, this type of principal cannot be impersonated, or you do not have permission
-> The subscription does not exist
-> Transactional replication – Administering distribution database size
-> Cannot execute as the database principal because the principal “dbo” does not exist, this type of principal cannot be impersonated, or you do not have permission. (Source: MSSQLServer, Error number: 15517)


-> DBCC Shrinkfile executes forever
-> Conversations with State Disconnected_inbound piling up in Sys.Conversation_Endpoint


-> Database ‘model’ cannot be opened. It is in the middle of a restore.
-> SQL resources not coming online after patching
-> The database owner SID recorded in the master database differs from the database owner SID recorded in database ‘msdb’. You should correct this situation by resetting the owner of database ‘msdb’ using the ALTER AUTHORIZATION statement.

-> SQL services fails after applying service pack
-> Error 1311.Source file not found: C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\Update Cache\KB4018073\ServicePack\redist\VisualStudioShell\VC10SP1\vc_red.msi. Verify that the file exists and that you can access it.
-> VS Shell installation has failed with exit code 1638
-> SQL Server Setup – Could not allocate space for object ‘dbo.Large Object Storage System object: 422212467425280’ in database ‘tempdb’ because the ‘PRIMARY’ filegroup is full
-> The User Data directory in the registry is not valid. Verify DefaultData key under the instance hive points to a valid directory.
-> The Instance ID ‘MSSQLSERVER’ is already in use by SQL Server instance ‘MSSQLSERVER.INACTIVE’
-> Common language runtime (CLR) execution is not supported under lightweight pooling
-> The query has been canceled because the estimated cost of this query (37) exceeds the configured threshold of 30. Contact the system administrator.


-> Creating DTSX files from existing SQL Services Integration packages


-> SQL Server Reporting Services Encryption Key Backup
-> SQL Server Reporting Services – The value for UrlRoot in RSReportServer.config is not valid. The default value will be used instead.


-> Stretch Database in SQL Server 2016
-> Adding a table to the stretch database
-> Disabling Stretch Database
-> Stretch database – Modifying the filter function

TSQL & Powershell

-> Query To get Table Statistics Details
-> TSQL to query commandlog table to check Alter Index duration
-> Script to list size of all tables in a SQL Server database
-> TSQL Queries related to Database Backup and Restore
-> TSQL query to find Enterprise features availability in a SQL Server Instance
-> Identifying databases that are no longer used
-> Archival Report – Getting before and after row count post data archival
-> Execute job step if a job is not running
-> Restore PRIMARY Filegroup only on a database using full backup
-> Viewing Allocation Unit Size of a NTFS Disk
-> Create HTML from TSQL / SQL Server Queries
-> Finding a table name from a page ID