sql server 2017

Cleanup historical data in Temporal table using Retention Policy

Temporal tables were introduced by Microsoft in SQL Server 2016. From SQL Server 2016 onwards, temporal tables can be used to capture DML changes on a table without writing a single line of code. We have already discussed temporal tables in multiple blogs which can help us to understand it in more detail: Temporal Table […]

Cleanup historical data in Temporal table using Retention Policy Read More »

Audit created and modified by user in temporal table (without trigger)

Microsoft introduced Temporal tables in SQL Server 2016. Temporal tables are system versioned tables that have built-in support for row-level change tracking. We can create a new table as a temporal table or we can convert an existing table into a temporal table. The temporal tables keep the current data into the main table and

Audit created and modified by user in temporal table (without trigger) Read More »

Python use case – Export SQL table data to excel and CSV files – SQL Server 2017

In this post, we are going to discuss how we can export SQL Server table data to an Excel file or to a CSV file using Python’s pandas library. Prior to SQL Server 2017, we could use one of the below methods to export data from SQL Server to Excel or CSV file: Create an

Python use case – Export SQL table data to excel and CSV files – SQL Server 2017 Read More »

SQL Server – Error 1061: The service cannot accept control messages at this time

Sometimes when we try to restart “SQL Server service” we might get an error “Windows could not stop the SQL Server (MSSQLSERVER) service on Local Computer” with error code and description “Error 1061: The service cannot accept control messages at this time“. In this post, “SQL Server – Error 1061: The service cannot accept control

SQL Server – Error 1061: The service cannot accept control messages at this time Read More »

The RPC server is unavailable – SQL Server 2017 installation error

During the installation of SQL Server 2017(Or other versions), we can get an error “The RPC server is unavailable” at the very last step of the installation process while executing the action “DReplayControllerConfigAction_install_postmsi_Cpu64“. “The RPC server unavailable error” might also occur at the “Server Configuration” step during the installation process. However, typically this error occurs

The RPC server is unavailable – SQL Server 2017 installation error Read More »

Python use case – Resampling time series data (Upsampling and downsampling) – SQL Server 2017

Resampling time series data in SQL Server using Python’s pandas library In this post, we are going to learn how we can use the power of Python in SQL Server 2017 to resample time series data using Python’s pandas library. Sometimes, we get the sample data (observations) at a different frequency (higher or lower) than

Python use case – Resampling time series data (Upsampling and downsampling) – SQL Server 2017 Read More »

Python use case – Import data from excel to sql server table – SQL Server 2017

If we need to import data from an excel file into SQL Server, we can use these methods: SQL Server Import Export Wizard Create an SSIS package to read excel file and load data into a SQL Server table Use T-SQL OPENROWSET query Use the read_excel method of Python’s pandas library (Only available in SQL Server 2017

Python use case – Import data from excel to sql server table – SQL Server 2017 Read More »

Python use case – Import zipped file without unzipping it in SSIS and SQL Server – SQL Server 2017

Import zipped CSV file without unzipping it in SSIS using SQL Server 2017 SQL Server Integration Services (SSIS) is one of the most popular ETL tools. It has many built-in components which can be used in order to automate the enterprise ETL(Extract, Transform, and Load). Also, if we need a customized component which is not

Python use case – Import zipped file without unzipping it in SSIS and SQL Server – SQL Server 2017 Read More »

Import CSV file into SQL Server using T-SQL query

Sometimes, we need to read an external CSV file using T-SQL query in SQL Server. Due to some functional limitations, we cannot use the import-export wizard functionality in such kinds of scenarios as we need the result set in the middle of the execution of the other queries. There, we can use the BULK INSERT

Import CSV file into SQL Server using T-SQL query Read More »

Python use case – Convert rows into comma separated values in a column – SQL Server 2017

In this post, we are going to learn how we can leverage python in SQL server to generate comma separated values. If we want to combine all values of a single column it is fairly easy as we can use COALESCE function to do that. Here is a reference to the already existing post. But have

Python use case – Convert rows into comma separated values in a column – SQL Server 2017 Read More »