After a good 2 hours of searching what the **** happened and Visual Studio stopped working, I finally found a working solution… Just copy all… Read More »Visual Studio 2012.4, “Run As Administrator” -> “The application cannot start” error
A few days ago, I was searching for a way to export MS SQL schema of all databases of a server for backup and migration purposes. Although I found some tools, what I needed was a way to get stored procedures, functions, views, triggers and everything even if it was encrypted.
Since I couldn’t find a way to automate this (e.g. run it every night to backup schema of my server), I thought it would be a nice weekend project.
You can read more about it, or download project from https://github.com/georgekosmidis/mssql-schema-dump!
After calculating the Greek Orthodox Easter, it was time for the public holidays calculation. With the Easter calculation ready, it proved to be much easier than expected!
Read More »C#: Calculating all Greek Public Holidays for any given year
Some time ago I was called about an online calendar for a company’s portal. The need was to inform employees about public holidays for the requested year. In Greece, some of those holidays are static, meaning they occur the exact same date each year, and some are based on the Orthodox Easter, so they move from date to date. There are a lot of online services that can return these information, but I thought I should give it a go and try writing the Orthodox Easter calculation offline. Saying that, I found the algorithm online, and since I was there I also found the Catholic Easter algorithm.
This is a post for the calculation of the two Christianity events, and in a later post I will also publish the public holidays calculation.
(Have in mind that since the methods return DateTime, “every possible year” is not quite accurate! And besides this, both algorithms have problems after year 4200. You can read more about it here: http://en.wikipedia.org/wiki/Computus)
So you end up with a query like this:
That yields something like this:
ID ... KEY RANK 5 ... 5 765 2 ... 2 322 3 ... 5 128 1 ... 1 75
And you are missing a percentage column. Well, not any more!
Read More »SQL Server: Using RANK to display PERCENT (percentage of relevance)
Did you know that HTTP_X_FORWARDED_FOR can return multiple IPs? According to http://en.wikipedia.org/wiki/X-Forwarded-For the format is:
X-Forwarded-For: client, proxy1, proxy2
I usually store triggers, store procedures, functions, queries etc in sql files in an SVN repository. I then use a simple app I wrote, that just opens each file and executes it. The problem of course is CREATE and ALTER. I can’t use CREATE because the same trigger might already be there. On the other hand I couldn’t use ALTER because some triggers might be new.
Since there is no DROP TRIGGER IF EXISTS, I came up with this:
SQLCLR is a technology for hosting of the .NET CLR engine inside SQL Server. Adding an assembly can be a lifesaver sometimes, since the limitations of coding in TSQL stored procedures, triggers or functions are a lot and profound.
I came across the following weird behaviour in an ISABOUT query in SQL SERVER, that involves weight keyword and the final rank of the results. I want to describe that behaviour here, just in case some has a good explanation over it!
This posts assumes some basic knowledge of querying with full text search