Tags » SQL Server

SQL Server: Script to get databases mirroring status

This script query the sys.database_mirroring to get all databases mirroring status


DB_NAME(database_id) As DatabaseName,

CASE  WHEN mirroring_guid IS NOT NULL THEN 'Mirroring is On'

ELSE 'No mirror configured'

END AS IsMirrorOn,


CASE  WHEN mirroring_safety_level=1 THEN 'High Performance'

WHEN mirroring_safety_level=2 THEN 'High Safety'

ELSE NULL END AS MirrorSafety,


mirroring_partner_instance AS MirrorServer

FROM sys.database_mirroring

… 8 more words
SQL Server

Service Pack - SQL Server 2008 R2 SP3

Despite the fact that end of mainstream support ended for SQl Server 2008 R2 earlier this year, Microsoft have released SQL Server 2008 R2 Service Pack 3. 227 more words

SQL Server

SQL server version Compatible with Dynamics GP

i was trying to recreate GP 10.0 environment at my laptop and got SQL server version compatibility issue. in order to remove SQL Server version compatibility issue only way is to use compatible versions with dynamics GP. 62 more words


I just saw a question on SQLServerCentral about NULLs behavior and thought I could write something about the common gotchas when using NULL in T-SQL, and why they behave the way they do. 430 more words

SQL Server

Find all Locks and Blocks on a Database or Server – Point in time

On one of our Databases I noticed frequent blocks resulting web page timeouts, had to analyze what is resulting these blocks and which tables are major contributors. 381 more words


Shrink Database & Log file using tempdb as a sampler

One of the main functions of a Database Administrator is to keep an eye on free space within the database and database files, auto growth etc which should be inline with storage capacity.  224 more words

Sql Server

High Performance Un-pivot Transformation Using a Pivot Table

Of all the methods to pivot or un-pivot data found in SQL or Dot Net using Linq there is none faster than using a Pivot table. 1,102 more words

SQL Server