Skip to content

The Dummy Programmer

Stories of daily programming

  • Home
  • My other dummy projects
  • Games
    • Space Y: An Asteroids clone
  • Services
    • What’s my user agent
    • What’s my IP address
  • 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 pagination

1 2 Next

Copyright © 2024 The Dummy Programmer | Privacy Policy | Terms of use |

Powered by PressBook Masonry Dark

Manage Cookie Consent
This site doesn’t collect user personal data and doesn’t install profiling or analytical cookies, either its own or from third parties. Read our privacy policy for more info.
Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
Manage options Manage services Manage {vendor_count} vendors Read more about these purposes
View preferences
{title} {title} {title}