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

Merge two or more historical tables with Sql Server T-SQL – Part 2

In the previous post we saw how to merge two or more historical tables with a T-Sql script. We will now propose a different solution to the problem that also takes into account the presence of gaps in the validity periods of the records. We’ll start from the same test database we used for the…

Read More “Merge two or more historical tables with Sql Server T-SQL – Part 2” »

Sql Server

Merge two or more historical tables with Sql Server T-SQL – Part 1

In this post we are going to explain how we can merge the content of two or more historical tables in a Sql Server database with some T-SQL queries. I’ll try to be more clear: Create a basic data structure Let’s start by creating some tables that we will fill with some fake data, just…

Read More “Merge two or more historical tables with Sql Server T-SQL – Part 1” »

Sql Server

Sql Server error: A severe error occurred on the current command.  The results, if any, should be discarded.

In recent days I was working on one of my projects, in which it was necessary to install Sql Server 2019. I restored the database I was working on in this new Sql Server instance and I started using it. Calling one of the database’s stored procedure, which worked perfectly in the previous Sql Server…

Read More “Sql Server error: A severe error occurred on the current command.  The results, if any, should be discarded.” »

Sql Server

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

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 and SARGables predicates

Today I will share with you some suggestions about using SARGable predicates. First of all let’s start explaining what is a SARGable predicate…SARGable stands for Search Argument able: in a nutshell a predicate is SARGable if Sql Server can use an index to improve the execution of the query. Use the following operators to build…

Read More “SQL Server and SARGables predicates” »

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

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}