Quantcast
Channel: T-SQL – Pavel's SQL Pages
Browsing all 18 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

Fastest CSV strings splitting using CLR (T-SQL vs. CLR revisited)

In one my previous blog post SQL Server – String splitting (T-SQL vs. CLR) I was comparing speed of T-SQL solution for string splitting vs. CLR RegEx solution. Although the CLR RegEx is fast enough, it...

View Article



Fuzzy strings matching using Levenshtein algorithm on SQL Server (T-SQL vs CLR)

Levenshtein algorithm is one of possible fuzzy strings matching algorithm. Levenshtein algorithm calculates Levenshtein distance which is a metric for measuring a difference between two strings. The...

View Article

Random numbers in query

Some times you may want to select rows from some table and in each row you would like to have some random number generated. You may want to try the RAND() function. However, it will generate a random...

View Article

Image may be NSFW.
Clik here to view.

Selecting random records from a table

Some time you may come to a situation, when you have a table and need to get only a few random records from it. You can come with a question how to achieve this on SQL Server. You may come with...

View Article

Automating CRUD procedures generation using T-SQL

CRUD procedures represent a good way how to secure the database. When using CRUD procedures, no user has direct access to the database tables and instead of this is forced to use parameterized...

View Article


Cloning user rights in database

Some times it could happen, that you need to create a new database user, which will have exactly the same right as another existing user. In ideal scenario, you will have all the necessary rights...

View Article

Querying agent job status, executing and waiting for job completion from...

In this article I would like to describe how easily you can query an Agent Job status from within T-SQL command and also how it is possible to execute an agent job and wait for it’s completion. It can...

View Article

Image may be NSFW.
Clik here to view.

Querying Active Directory on SQL Server using T-SQL

You may come to a situation when you need to retrieve list of users, groups or other information from Windows Active Directory (AD) or another LDAP (Lightweight Directory Access Protocol) from within...

View Article


MS SQL 2012 Window functions introduction

Among lot of new features introduced in SQL Server 2012 also a new Windowing functions were introduced. The new functionality allow us to use the ORDER BY clause in the OVER clause with aggregate...

View Article


SQL Server is wasting space when altering fixed length column

Recently I was going through the archives of posts by Kalen Delaney blog and I came across very interesting post Did you know? — Altering the length of a fixed-length column.  This article gives...

View Article

SQL Server – Cloning User Rights – updated sp_CloneRights on GitHub

I’ve just made publicly available on GitHub a more advanced version of my original sp_CloneRights stored procedure I’ve posted in posted in past Cloning user rights in database. The new stored...

View Article

Clone / Copy SSIS Server Variables Among Environments –...

You have SSIS projects deployed in the SSISDB catalog. You are using environments and environment variables for passing parameter values to SSIS Executables. This is a very common scenario. You come to...

View Article

Image may be NSFW.
Clik here to view.

Getting Database Rights Assignment Overview – sp_HelpRights on GitHub

You have a user database with bunch of users and database roles and other database principla types. You need to have an insight into the rights assignments. You would like to know what rights are...

View Article


Generating Partition Function – sp_tblCreatePartitionFunction available don...

If you are working with large databases you have come to situation when you need to partition the large tables. To be able to partition a table, you need to create a Partition Function. Creation of...

View Article

Clone / Copy SSIS Catalog Project Configuration – sp_SSISCloneConfiguration...

When you deploy a SSIS project to SSIS Catalog, you have the possibility to Configure the deployed SSIS project so you do not need to pass the parameter execution values each time you are executing the...

View Article


Image may be NSFW.
Clik here to view.

Revealing content of encrypted SSISDB Environment variables –...

You may come to a situation when you need to update a password or some other kind of sensitive information in the SSISDB catalog environment variables. Eg. password has changed etc. The easiest way to...

View Article

Image may be NSFW.
Clik here to view.

SQL Server – Cloning User Rights – New Refactored version of sp_CloneRights...

Just published a new updated and completely refactored version of the sp_CloneRights stored procedure. The new version is available in my SQL Scripts repository on GitHub under the RightsManagement...

View Article


Image may be NSFW.
Clik here to view.

Cleanup of Retention Window in Partioned Tables – sp_tblCleanupRetentionWindow

In my GitHub collection of SQL Scripts is now available a new stored procedure sp_tblCleanupRetentionWindow under the TablesManagement/Partitioning folder. Help for the function is available in the...

View Article
Browsing all 18 articles
Browse latest View live


Latest Images