Skip to content

The Dummy Programmer

Stories of daily programming

  • Home
  • The Dummy Programmer Robot
    • Overview
    • Version history & downloads
    • Tutorials
      • TDP Robot – The basics
      • A simple SQL Server backup solution
      • A simple SQL Server backup solution – A next step
  • My other dummy projects
  • Games
    • Space Y: An Asteroids clone
  • Services
    • What’s my user agent
    • What’s my IP address
  • Donate
  • About
  • Toggle search form

Category: Sql Server 2016

Sql Server error: Cannot construct data type date, some of the arguments have values which are not valid.

Imagine waking up on a cold winter morning, and receiving an error from your customer that reads as follows: “Cannot construct data type date, some of the arguments have values which are not valid.” Apart from the error message and the web page in which it occurred, I didn’t have much other information. I don’t…

Read More “Sql Server error: Cannot construct data type date, some of the arguments have values which are not valid.” »

Sql Server

Multi-tenant database in SQL Server

Before talking about a multi-tenant database, let’s explain in a nutshell what a multi-tenant system is. Multitenancy is a software architecture that allows a single instance of software to be used by multiple organizations or groups of users. Database side, one possible implementation is that you use a single database instance which will contain data…

Read More “Multi-tenant database in SQL Server” »

Sql Server 2016

Getting SQL Server sample databases

Good morning my friends! It’s been exactly a month since we last spoke! I’m very busy with a new project, which I hope to share with you soon. Apart from that, I want to share with you a link which I think will be useful: https://github.com/microsoft/sql-server-samples/tree/master/samples/databases/northwind-pubs What does it contain? From the link above you…

Read More “Getting SQL Server sample databases” »

Sql Server

Sql Server Instant File Initialization

Sql Server Instant File Initialization is a Sql Server option that, I have to admit, I didn’t know. Activating this option you can slightly improve performances when Sql Server needs to grow data files and during backup and restore of a database. When Sql Server grows data files and transaction log files, it fills with…

Read More “Sql Server Instant File Initialization” »

Sql Server

Sql Server add constraint WITH NOCHECK

Good morning guys! Today I want to talk about a Sql Server feature that you could use when creating foreign key constraints: the WITH NOCHECK option. If you look at the name it seems that with that option, the constraint is not enforced… but it is not true. You can check this by running this…

Read More “Sql Server add constraint WITH NOCHECK” »

Sql Server

Get SQL Server version in T-SQL

Hi guys!! Today I want to share a simple but useful trick to show the version of your SQL Server. Just type the following command: SELECT @@VERSION This is the result in my development machine: Microsoft SQL Server 2019 (RTM-GDR) (KB4517790) – 15.0.2070.41 (X64) Oct 28 2019 19:56:59 Copyright (C) 2019 Microsoft Corporation Developer Edition…

Read More “Get SQL Server version in T-SQL” »

Sql Server

Get all referencing tables of a table in Sql Server

Today I want to talk about how to get all referencing tables of a Sql Server table. It is useful, for example, if you need to delete a certain record but you can’t because is referenced by many other tables. In short we will see how to accomplish that… First of all we need a…

Read More “Get all referencing tables of a table in Sql Server” »

Sql Server

Sql Server: apply an aggregate function to fields values in a row

Did you ever need to apply an aggregate function to fields values in a row? It happened to me just few days ago… I will try to explain better what I mean… Suppose you have a Sql Server table created with the following script: CREATE TABLE ROW_AGGREGATE_EXAMPLE ( ID INT IDENTITY(1, 1) PRIMARY KEY CLUSTERED,…

Read More “Sql Server: apply an aggregate function to fields values in a row” »

Sql Server

How to know who is blocking a query in Sql Server

It’s been a while since we last heard… The Dummy Programmer was really really busy and couldn’t write any post. But now I’m back to talk about a problem I came across. One of my applications in the production environment seemed to be stuck doing a series of database queries. My suspicion is that some other…

Read More “How to know who is blocking a query in Sql Server” »

Sql Server

Improving SQL Server cursor performance

Hi everyone! Today I want to talk about a performance problem I had a few days ago using a SQL Server cursor. Imagine using a cursor in the following classic way: DECLARE @ID INT DECLARE @ITEM_CODE VARCHAR(50) DECLARE MY_CURSOR CURSOR FOR SELECT ID, ITEM_CODE FROM MY_TABLE T LEFT JOIN A_TABLE T1 ON T.ID = T1.ID LEFT…

Read More “Improving SQL Server cursor performance” »

Sql Server

Posts navigation

1 2 Next

Copyright © 2022 The Dummy Programmer | Privacy Policy |

Powered by PressBook Masonry Dark