T-SQL Tip: Inserting Leading Characters to a String

This post, is actually a T-SQL tip, on how to easily insert leading characters to a string. The Scenario for Inserting Leading Characters Consider that  you have a fixed-length table column for which you want to add leading characters, so that all its records, values with the same number of characters. How to Insert Leading … Read more…

T-SQL Tip: Retrieving Security-Related Info for SQL Server Logins

—— Retrieves Security-Related Information— for all the SQL Server Logins—— SQL Server versions  supported: SQL Server 2005 or later—SELECT [name] as LoginName,LOGINPROPERTY ([name] , ‘DefaultDatabase’) as DefaultDatabase,LOGINPROPERTY ([name] , ‘DaysUntilExpiration’) as DaysUntilExpiration,(CASE ISNULL(LOGINPROPERTY ([name] , ‘IsExpired’),0) WHEN 0 THEN ‘False’ ELSE ‘True’ END) as IsExpired,(CASE ISNULL(LOGINPROPERTY ([name] , ‘IsLocked’),0) WHEN 0 THEN ‘False’ ELSE ‘True’ END) … Read more…

Selected Tweets of Year 2012!

Hello friends, Another year has come to an end and as being faithful to the “tradition” of posting in the last day of every year my selected tweets for the year that ends, here I am, posting the “Selected Tweets of Year 2012!“. It was another great year of interaction with you, the SQL Server Community. … Read more…

T-SQL Tip: Getting the File Locations for all DBs in a SQL Server Instance

—— Dynamically builds  T-SQL statements for retrieving the file — locations for all the databases in the SQL Server Instance—— SQL Server versions  supported: SQL Server 2005 or later—SELECT ‘use ‘+ [name]+’; select ”’+[name]+”’ as DBName,cast ([name] as varchar(45)) as LogicalFileName,cast (filename as varchar(100)) as FileName from sysfiles;’ as SQLStatement FROM master.sys.databases Details: Just execute the statements generated … Read more…

Internal Query Processor Error: The query processor could not produce a query plan

OK folks, it did happen at some point, to get this error message: Internal Query Processor Error: The query processor could not produce a query plan. For more information, contact Customer Support Services.   Reproducing the Internal Query Processor Error Message I was trying to execute the following query: SELECT *  FROM dbo.tbl1 WHERE  tbl2ID=(SELECT … Read more…

Handling Disk Space Issues During Heavy Index Rebuild Operations

There are times where you need to massively rebuild indexes on some really large databases, after indicated by the relevant analysis of course. However, rebuilding indexes, requires also the adequate amount of free disk space that will be used during the rebuild operation (mainly for the sorting process). Usually the required space is the size of … Read more…

[Webcast] SQL Server 2012: The Database Engine

– Celebrating 250.000+ Visits! – SQL Server 2012 shipped with a plethora of useful new features. In this webcast we will see the majority of the Database Engine features. To this end, we are going to see enhancements that fall into the following SQL Server areas: High Availability Manageability Enhancements Programmability Performance & Scalability Security … Read more…

[Celebrating 250.000 Visits!] SQL Server 2012 – The Database Engine [TRAILER]

– Celebrating 250.000+ Visits! – Within the context of celebrating the 250.000+ visits on my blog, on Wednesday, October 17th, 2012, I will make available my brand new webcast on SQL Server 2012 focusing on its Database Engine features. In order to spread the news about the webcast this time I thought of doing something … Read more…

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…

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…

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…