Don’t cutoff yourself with dates in T-SQL – Did you know…

Almost all the applications we use have a lot of options. And, sometimes we even stumble across them by accident. Who's ever heard something like "Normal user don't even use 5% of Excel capabilities!"? Other options, we know they exist but because the default value it’s ok (so far) we tend to forget it. It … Continue reading Don’t cutoff yourself with dates in T-SQL – Did you know…

Did you know…you can change the default file encoding for new query on SSMS?

If you have been reading my last blog posts, you know that I’m currently working on a SQL code migration from Firebird to SQL Server. The client provided the scripts with all modules (Stored Procedures, functions, etc) and the steps I'm following (roughly speaking) for converting are: Open new query window Copy and paste de … Continue reading Did you know…you can change the default file encoding for new query on SSMS?

Using CAST() function with User-Defined Data Types…Did you know…

I'm converting some Firebird database code to T-SQL and I'm seeing a lot of code that doesn't work in the same way that SQL Server. No surprise - I already expected that but for those that still say that "all engines/databases are equal"..."is SQL right?" here is another proof that is not true. On Firebird … Continue reading Using CAST() function with User-Defined Data Types…Did you know…

Did you know…you can’t do arithmetic operations with datetime2 like with datetime?

I’m currently working on a SQL code migration from Firebird to SQL Server and I hit an error that I haven’t seen for some time. The error message is the following: Msg 206, Level 16, State 2, Line 4 Operand type clash: datetime2 is incompatible with int This ringed the bell right away! Somewhere on … Continue reading Did you know…you can’t do arithmetic operations with datetime2 like with datetime?

Using Common Table Expression (CTE) – Did you know…

Today I will write just a short blog post to do a quick reminder! I still hear a lot of people suggesting CTEs because they think it works like a temporary table (you populate the table and then it can be/is reutilized). It doesn't! From de documentation: Specifies a temporary named result set, known as … Continue reading Using Common Table Expression (CTE) – Did you know…

DELETE data on SQL Server HEAP table – Did you know…

Before I complete my question let me provide context. I've received an alert saying that a specific database could not allocate a new page (disk was full) The message that you will see on the SQL Server Error log is: Could not allocate a new page for database '' because of insufficient disk space in … Continue reading DELETE data on SQL Server HEAP table – Did you know…