SQL Queries Tuning by Brent Ozard

Hi, today I want to share with you training that I get from one colleague today. This is available at Watch Brent Tune Queries [Video] I have to said that I really enjoy this presentation and charisma of the presenter. And I learn a lot from his presentation. So I decided to share it with you. There is one thing I cannot agree from my experience which is changing requirements to tune up queries. I never ask Continue ReadingSQL Queries Tuning by Brent Ozard

SQL Ninja moves Data in Auto Balancer Loop

Hi, today I want to share with you one of my last invention. That is extremely useful when you need to move data for example to historical or archive tables on your SQL Server. Imagine that the same moment you move your data someone can with lower probability use table you move data from. When you decide to insert data to new table and then delete them of course in delete query you lock whole table. Now Continue ReadingSQL Ninja moves Data in Auto Balancer Loop

SQL Ninja PK Clustered or Non Clustered for GUID

Hi today I would like to share with you experiment I did small experiment for checking improvement of operations in table with primary key that has UNIQUEIDENTIFIER (GUID) type and it is PRIMARY KEY in this table. I want to check what if PK will be CLUSTERED (by default) and what if PK will be NONCLUSTERED index. There is very common question on any job interview so, probably all of you already know the different between both Continue ReadingSQL Ninja PK Clustered or Non Clustered for GUID

SQL Ninja replace for Cursor with CTE

Hi, today I want to share with you results on nice experiment and its code. I like C#, but currently most of my work attention is focused on T-SQL code. And making optimizations of performance of T-SQL code. I have both SQL Ninja and DB Council titles at work not by the accident, you know. And I want to show you how to replace cursors with CTE in good way. Cursors in general are bad and working Continue ReadingSQL Ninja replace for Cursor with CTE

PLSQLTester

Hi, today I am happy to announce PLSQLTester that is version of TSQLTester that works on Oracle database instead of Microsoft SQL Server. It works basically the same. and below you can find how it looks. It depends only on ODP.NET provider so, assembly Oracle.DataAccess need to be installed to build this solution. And it works the same way like TSQLTester there are following parameters: connectionStringFile, testCodeSqlFile, newCodeSqlFile, oldCodeSqlFile and preCodeSqlFile, postCodeSqlFile. And last two are not Continue ReadingPLSQLTester

TSQLTester for SQL Ninja with Mocking

Hi, I am using very often TSQLTester from the moment it was created. And it saved me a lot of time with my performance challenges. Of course my favorite advantage of TSQLTester is testing content of data. Today I would like to extend first implementation and give you option for mocking of procedures of functions that in standard production cases connecting to the Service Bus or writing to some Queue implementations in the middle of our code Continue ReadingTSQLTester for SQL Ninja with Mocking

TSQLTester for SQL Ninja

Hi, today I would like to share with you idea of testing tool for T-SQL developers who want to not only replace stored procedures with fasters stored procedures but also want to be sure that old code on SQL Server produces exactly the same results as a new optimized and tuned up one. I created this tool as command line to easy integrate with possible automate of testing and TSQLTester.exe has 4 parameters. All of those parameters Continue ReadingTSQLTester for SQL Ninja