Celebrating 250.000 Visits!

Today, my blog has reached the 250.000 visits. That’s 1/4 of a million! 🙂 I started this blog four years ago with a simple purpose: Share knowledge with the Community. Be a part of the Community. Four years later I must say that I have received more than what I gave. The interaction with you, … Read more…

T-SQL Tip: How to Create a Simple Linked Server Between SQL Server Instances

If you are looking for a T-SQL tip, on how to create a simple linked server between SQL Server instances, then the below tip might come in handy.   T-SQL Example for Creating the Linked Server The below T-SQL code does just that: — –Note: The Entire Operation Takes Place on the Local Instance — … Read more…

Getting the Disk Usage Statistics for all Tables in a Database

I know, there are standard reports and other GUI tools for doing this task for SQL Server 2005 or later but what about when you need to extract such information from a SQL Server 2000 instance or when you just want to write some code? 🙂   Get the disk usage statistics using the undocumented … Read more…

Snippets Generator v1.0 – Stable Version Now Available!

[Update 2018] Please visit Snippet’s Generator page for the latest release of the tool and much more. We are very happy to announce that the first stable version of Snippets Generator is now available! Do you need to create T-SQL snippets for your SQL Server 2012 instance? Snippets Generator is the tool for the job! And of … Read more…

How To Get Basic SQL Server Instance Info (T-SQL Script)

With the below T-SQL script, you can get basic SQL Server instance info such as: Full instance name SQL Server version Edition Collation Number of databases Product level (i.e. SP-level) …and more   The T-SQL Script The script uses the built-in SQL Server function SERVERPROPERTY. SELECT SERVERPROPERTY(‘ServerName’) AS FullInstanceName, REPLACE(SUBSTRING(@@version,0,CHARINDEX(‘-‘,@@version)),’Microsoft ‘,”) as FullSQLVersion, SERVERPROPERTY(‘ProductVersion’) AS ProductVersion, SERVERPROPERTY(‘ProductLevel’) … Read more…

T-SQL Tip: Retrieving Database File Sizes

The following script generates T-SQL statements that when ran, they return file size information for all the user databases on a SQL Server instance. –Script that generates T-SQL providing size information for all database files on a SQL Server InstanceSELECT ‘SELECT ”’+[name]+”’ as DBName,cast(f.name as varchar(25)) as DBFileName,f.Filename as PhysicalFileName,cast (round((f.size*8)/1024.0,2) as decimal(18,2)) as FileSizeinMB … Read more…

New Post Series: T-SQL Tips

Hello friends! I hope you are all having a great summer time! I am having a great summer time too, however I felt the need for some summer-blogging and so here I am, writing another article! 🙂 I will start this article with a simple question: How many times we all search the Web for … Read more…

Sequence Objects in SQL Server 2012 and Later

In this article, we will be discussing about Sequence objects in SQL Server 2012 and later, and see a relevant example. In an older article on our blog, we wrote on how someone can mimic the operation of Sequence Objects using other alternative ways. However, since SQL Server 2012 and later, Sequence Objects are available … Read more…

Could not load file or assembly ‘Microsoft.SqlServer.Smo, Version=10.0.0.0, …

I have recently experienced an issue which had to do with a third-party application that was trying to retrieve some meta information from a specific SQL Server Instance. It was actually trying to retrieve the names of all the databases contained within that instance. However it was returning the following error message (app code excluded): […….] … Read more…

Microsoft SQL Server MVP for the fourth year in a row!

Yep, it’s that time of the year again! Waiting for that magic email saying: Dear Artemakis Artemiou, Congratulations! We are pleased to present you with the 2012 Microsoft® MVP Award! This award is given to exceptional technical community leaders who actively share their high quality, real world expertise with others. We appreciate your outstanding contributions … Read more…

Retrieving Log Space Information within a SQL Server Instance – The Stored Procedure!

In yesterday’s post, we saw how we can retrieve log space information for all the databases within a SQL Server instance using the command DBCC sqlperf(logspace).   Creating the Stored Procedure Today we will refine the process even more by creating a stored procedure that returns log space information for a given database! –****************************** –CREATING … Read more…

Retrieving Log Space Information within a SQL Server Instance

In the everyday life of a Database Administrator there is the task of maintaining the database logs in terms of size they occupy on the disk. Of course, there are automated maintenance and reporting procedures for this task as well as for many other tasks but it is not few the cases where the DBA needs to … Read more…

How to retrieve size information for all the tables in a SQL Server Database

In an older post, we have discussed about, how you could rebuild all the indexes of a database in SQL Server by making use of the undocumented stored procedure “sp_MSforeachtable”.   Retrieving Table Size Info using sp_MSforeachtable Another common task is when you want to retrieve size information for all the tables in a database. … Read more…