Skip to content
  • Home
  • About
  • Contact
  • Legal
    • Privacy Policy
    • Cookie Policy

Peter Lalovsky

Keep it simple

Peter Lalovsky

Keep it simple
  • Home
  • About
  • Contact
  • Legal
    • Privacy Policy
    • Cookie Policy
SQL Job Agent: T-SQL Script to Shrink All Log Files on the Server

In some situations a scheduled shrink of the log files is needed to release disk space. The script bellow can be scheduled in SQL Server Agent Job.

Database Administration (DBA) Job Agent SQL Server T-SQL

SQL Job Agent: T-SQL Script to Shrink All Log Files …

  • Automation
  • Job Agent
  • T-SQL
by Peter Lalovsky
Published 2016-02-23

Let’s say that we have a SP with predefined parameters, i.e. @Parameter1 can hold values 1, 2 or 3; @Parameter2 can hold values of A, B, C or D and so on. This script creates all the possible combinations for the parameters of the SP and executes the SP as many times […]

Database Development T-SQL Unit Testing

T-SQL: Quick and simple Unit Testing of a Stored Procedure …

  • Stored Procedure
  • T-SQL
  • Unit Testing
by Peter Lalovsky
Published 2016-02-22
SSIS: FileName into Variables and Foreach Loop Container

Very often while exchanging data files with clients, a useful information is stored in the file name. This can be a client name prefix, date, time, the period that filtered the data in the file and so on. While loading the data into the database, we need to extract the […]

SSIS

SSIS: FileName into Variables and Foreach Loop Container

  • ETL
  • SSIS
by Peter Lalovsky
Published 2016-01-27

Very often we make changes to the design of an underlying objects, used by views. After we do this, we need to refresh the views to apply the changes. In this example we will: 1. Create View 2. Change the design of an underlying object 3. Refresh all the views […]

Database Development SQL Server T-SQL

T-SQL: Refresh View After a Change in the Design of …

  • SQL Server View
  • T-SQL
by Peter Lalovsky
Published 2015-06-06

Working with multi-value parameters in SSRS is always fun. We need to pick a good delimiter, add additional values like “ALL” or “BLANKS” and many others. In the following few lines I explain a logics to add a multi-value parameter to SSRS with additional values (all) to not apply the […]

SSRS

SSRS: Multi-value Parameter – (all), (blank), Value

  • Run-Around
  • SSRS
  • T-SQL
by Peter Lalovsky
Published 2015-05-12
Automating Task by using SQLCMD and Windows Scheduled Task

In a lot of situations we may not have permissions to use SQL Server Agent for automations of our back-end processes. I built a run-around that uses a Windows Scheduled Task, SQLCMD and Stored Procedure to run task. Work flow: 1. Windows Scheduled Task calls a .bat file at specific […]

CMD Database Administration (DBA) ETL SQLCMD

Automating Task by using SQLCMD and Windows Scheduled Task

  • Run-Around
  • SQLCMD
by Peter Lalovsky
Published 2015-04-11
Data Warehouse: Create Date Dimension (version 1)

Data Warehouse is “a system used for reporting and data analysis”. In general it is built by dim (dimension) and fact tables (structure and data tables). Here I create a stored procedure to build Date Dimension. Now it builds only calendar data and will be expanded to include “fiscal” data […]

Data Warehouse (DW)

Data Warehouse: Create Date Dimension (version 1)

  • Data Warehouse (DW)
  • Dates
  • ETL
  • T-SQL
by Peter Lalovsky
Published 2015-02-05

I built a function for reporting purposes that shows the duration in hh:mm:ss between two datetime columns. It can be used in a reporting tool to show the data in a log. The max difference in DATEDIFF() is 68 years. Quick and extended calculation (every year is a leap year): 68 years […]

T-SQL

T-SQL: udf_DurationHourMinSec() – Duration between start date and end date

  • Dates
  • T-SQL
  • User Defined Function
by Peter Lalovsky
Published 2015-01-13
T-SQL Optimization: Nonclustered Index and GROUP BY

In this example I play with the performance of a query that groups the data.

Optimization T-SQL

T-SQL Optimization: Nonclustered Index and GROUP BY

  • Optimization
  • Performance
  • The Price I Pay
by Peter Lalovsky
Published 2015-01-06

Using a multi-value parameters in SSRS reports is giving the users the flexibility to filter on one or more values. In the following example they can filter on one or more products and on one or more customers. SSRS is passing the parameters to the stored procedure as joined strings. […]

SSRS T-SQL

SSRS: Pass Multi-Value Parameters to Stored Procedure

  • Dynamic-SQL
  • SSRS
  • T-SQL
by Peter Lalovsky
Published 2014-12-23

Categories

Tags

Aggregate Assembly Automation Azure Azure App Service Azure Data Factory (ADF) Azure Data Lake (ADLS) Azure Synapse Backend Book Built-In Function Change Tracking CLR CSV Databricks Data Warehouse (DW) Dates DBA DDL Deployment Dynamic-SQL EAV ETL fabric framework Good Practice Hints MariaDB NULL Optimization Performance Python REST API Run-Around Running Total Running Value Serverless SQLCMD SQL Data Type SQL Server SSIS SSRS String T-SQL Training User Defined Function

Posts navigation

  • Newer posts Newer posts
    • 1
    • …
    • 5
    • 6
    • 7
  • Older posts Older posts

© 2026 Peter Lalovsky – All rights reserved

Powered by WP – Designed with the Customizr theme