Thursday, 30 April 2015

Windows Convert Text File Encoding

Sometimes UTF-8 encoding just doesn't cut it for some developments and there is need for another type of encoding.

Found this problem working with portuguese language, the accentuation was all wrong.

You can do this with powershell.

Just run this in windows powershell

gc -en utf8 file_with_utf8.txt | Out-File -en unicode filewith_unicode.txt

Useful when the files are really big.

Monday, 6 April 2015

How to add a timezone to datetimeoffset column

Sometimes developers forgot to give the appropriate datatype and the date timezone is simply truncated.

For instance,  you wanted to insert  the date 2015-04-06 17:37:03.106 +01:00 but at some point the type of the variable you stored the value was datetime as implicity conversion truncates de timezone

As shown in the following example

To fix this apply the function TODATETIMEOFFSET

And the result is

You loose some precision but for my case it's just fine,

Which SQL Server Editions supports Table and Index Partitioning

  • SQL Server 2012 and 2014 Enterprise Edition 
  • SQL Server 2008 R2 DataCenter and Enterprise Edition 
  • SQL Server 2008 Enterprise Edition
  • SQL Server 2005 Developer and Enterprise Edition

Thursday, 2 April 2015

Lightweight WebService Testing Tool

WebService Studio 2 available for download at

WebServices have evolved but there's still a lot of ASMX Web Service out there.

ASMX is simple and because it is simple, it isn’t very powerful, but you still have to work with them.

Instead of downloading SoapUI massive 1OO MB installer for basic testing why not use this tool 200KB Executable, I definitetly do!

Regular Expression Tester

Check out Great Online Regular Expression Tester, with a full reference help and awesome explanation of the regular expression that you're building. It's specially helpful when the regular expression starting getting big and it's hard to find mistakes

Monday, 15 October 2012

View user permissions in SQL SERVER

Hi, To check your permissions just run the following queries and you'll get a list of assigned permissions SELECT * FROM fn_my_permissions(NULL, 'SERVER'); USE YourDatabaseName; SELECT * FROM fn_my_permissions (NULL, 'DATABASE'); GO

Tuesday, 10 April 2012


Whenever this error happens


Check you connection string if the provider is

In my case the was because I had a connection string with Provider=SQLNCLI.1 from Integration 2005 and when I upgraded to 2008 didn't change it.

It took me along time to find this out hope it helps