Tuesday, February 17, 2015

SQL Code Guard v2.7 released

Hola!
SqlCodeGuard v2.7 is just released.
To be brief - major changes:
1. Added command line utility
2. Added scgallow(issue)/scgignore(issue`)to control which issues should be registered
3. Added [SC004] Found todo item. You can use "--# todo <text>", "--# bug <text>", "--# fix <text>" or "--# warning <text>" marks in your scripts.
4. Added support for VS2013
5. SQL Code Guard moved to .Net Framework 4.0

Full list of changes can be found here 
Bon appétit!





Monday, February 9, 2015

ExpressProfiler - new build published

Just published new signed build of ExpressProfiler - few nice improvements like advanced search, stay on top window, transparency - just to make life easier
Actually there is no change since last august, i simply build, sign and publish version that already was in CodePlex's TFS, but now you can get binaries.

Saturday, November 15, 2014

How to fix: Visual Studio 2012 startup problem: The 'HDIProjectPackage' package did not load correctly.

After installing Community Edition of VS2013 with some additional packages i've noticed that my VS2012 starts failing to start with message like "The 'HDIProjectPackage' package did not load correctly. The problem may have been caused by a configuration change or by the installation of another extension. You can get more information by examining the file 'C:\Users\************\AppData\Roaming\Microsoft\VisualStudio\11.0\ActivityLog.xml'."

Activity log shows

SetSite failed for package [HDIProjectPackage]
End package load [HDIProjectPackage]
{665BA479-E656-4485-9097-7CE2A22A90F2} (just to let Google to find this page)

Google knows nothing about HDIProjectPackage. I dont know how to fix errors with VS2012. I'm stuck!
After 24 hours of thinking and meditation (and several reinstalls of both VS2012 and VS2013) I've found that the problem was with "Microsoft Azure HDInsight Tools for Visual Studio" which I've installed via Web Platform Installer
HDIProjectPackage->HDInsight, looks similar, right?
So I uninstalled "Microsoft Azure HDInsight Tools for Visual Studio" and my VS2012 now alive!!!!!
And I can continue to develop next release of SqlCodeGuard with such nice features like, say, preprocessor commands to disable specific issues in particular scripts (or even - part of script)

Sunday, October 5, 2014

SQLSaturday 311, Sofia, October 11

Making last changes before sqlsat 311.
By the way, did you ever visited SQL Saturday? No? Why?
SQL Saturday is fun, SQL Saturday is free, SQL Saturday is just what you need!
Good place to meet famous speakers from all around the world, ask them question that cannot be answered by usual people, make new friends :)


Monday, September 15, 2014

To be brief. What to do when PATH variable is too long to be real PATH.

Sometimes after installing pretty useful addins when starting SSMS you can see error message like "Exception has been thrown by the target of an invocation"

That can mean that your PATH variable is tooooo long to fit some system functions - and SSMS crashes.
Question "Why one function allows to write value that other function cannot read?" falls far beyond this topic.
So - what can you do?

First that came into my mind is manually change PATH variable - remove entries that are no longer needed and replace full folder names with the same names but in 8.3 format.
But stop! My PATH variable is more than 2K chars long! I dont want to make all these changes by my own hands!
Lets write small  program instead, ok?

using System;
using System.Runtime.InteropServices;
using System.Text;

namespace ShortenPath
{
    class ShortifyPath
    {
        [DllImport("kernel32.dll", SetLastError = true)]
        private static extern int GetShortPathName(String pathName, StringBuilder shortName, int cbShortName);
        static void Main(string[] args)
        {
            string path = Environment.GetEnvironmentVariable("PATH");
            Console.WriteLine("Current path value:{0}",path);
            string[] chunks = path.Split(new char[] {';'},StringSplitOptions.RemoveEmptyEntries);
            StringBuilder sb = new StringBuilder();
            foreach (string chunk in chunks)
            {
                StringBuilder sb1 = new StringBuilder(500);
                int n = GetShortPathName(chunk, sb1, 500);
                if (0 == n)
                {
                    if (2 != Marshal.GetLastWin32Error())
                    {
                        Console.WriteLine("Something went wrong...");
                        Console.WriteLine("{0}", Marshal.GetLastWin32Error().ToString());
                        return;
                    }
                    else
                    {
                        sb1.Append(chunk);
                    }
                }
                sb.AppendFormat("{0};", sb1.ToString());
            }
            Console.WriteLine("Path is shortened! Old len: {0}, new len {1}",path.Length,sb.ToString().Length);
            Console.WriteLine(sb.ToString());
        }
    }
}

Compile it using csc.exe
C:\Windows\Microsoft.NET\Framework\v2.0.50727\csc.exe ShortenPath.cs

And voila!
Run it and the program will print old value of PATH variable and the new value with shortened folder names. If you agree with result then you can use new value as value for PATH variable.
In my case I've saved about 500 chars from 2000.

Monday, August 18, 2014

SQL Code Guard v2.6 released

Today we released new version of SQL Code Guard, 2.6
Main changes:
1. Bug fixing
2. Small GUI and usability improvements
3. Fixed support of SQL2014
4. Changed behavior of some issues.

Enjoy!

Monday, August 4, 2014

ExpressProfiler - new release

Just released new build of ExpressProfiler.
No major changes, just cosmetic improvements - shortcut here, confirmation dialog there, new captured events (SQL:StmtStarting/Completed, Blocked Process report), descriptions for events/columns.
Still digitally signed, still 2 options - installation package (including Red Gate Ecosystem registration ) and standalone application.

Also do not forget to try our main t-sql tool - Sql Code Guard. It is really cool :)