Azure-Sql-Db

SDU Tools: List user access to Reporting Services content items

SDU Tools: List user access to Reporting Services content items

Finishing up my recent theme of running queries against the SQL Server Reporting Services catalog. I often need to list which users have access to which items in the SSRS catalog.

So, in our free SDU Tools for developers and DBAs, we added a procedure that does just that. It’s called RSListUserAccessToContent.

It takes two optional parameters:

@RSDatabaseName sysname - the name of your SSRS database

@IsOrderedByUserName bit - should the output be ordered by user name?

2019-10-30

SDU Tools: List user access to Reporting Services

SDU Tools: List user access to Reporting Services

Continuing my recent theme of running queries against the SQL Server Reporting Services catalog, I often need to list which users have access to the service.

So, in our free SDU Tools for developers and DBAs, we added a procedure that does just that. It’s called RSListUserAccess.

It takes two optional parameters:

@RSDatabaseName sysname - the name of your SSRS database

@IsOrderedByUserName bit - should the output be ordered by user name?

2019-10-23

SDU Tools: List content items in the SQL Server Reporting Services catalog

SDU Tools: List content items in the SQL Server Reporting Services catalog

I mentioned last week that I’ve been needing to write queries against the SQL Server Reporting Services catalog. I often need to list the items that are contained in the SSRS catalog.

So, in our free SDU Tools for developers and DBAs, we added a procedure that does just that. It’s called RSListContentItems.

It takes two optional parameters:

@RSDatabaseName sysname - the name of your SSRS database

@IsOrderedByUserName bit - should the output be ordered by user name?

2019-10-16

SDU Tools: SQL Server Reporting Services Catalog Types

SDU Tools: SQL Server Reporting Services Catalog Types

Lately, I’ve been needing to write queries against the SQL Server Reporting Services catalog. And if you’ve ever tried that, you’ll find that items in the catalog have a type, but there’s no table or view that turns that type (a number) into a name.

So, in our free SDU Tools for developers and DBAs, we added a simple view that does just that. It’s called RSCatalogTypes.

Find out more

You can see it in action in the main image above, and in the video here:

2019-10-09

SDU Tools: ROT13 Encode and Decode in SQL Server T-SQL

If you used computers much in the 1980’s or 1990’s you’ll remember jokes that circulated all the time, but encoded in ROT13. It was a type of Caesar Cypher or Shift Cypher where the letters in the original words were shifted by a fixed number of positions in the alphabet to create the cyphertext.

ROT13 was a specific type of shift cypher where, for our alphabet of 26 characters, a 13 character shift is applied. That means that the same function can be used to encode text and then to decode the same text.

2019-10-02

SDU Tools: Extracting tokens from CSV rows in T-SQL

SDU Tools: Extracting tokens from CSV rows in T-SQL

There are a few things in IT that seem to rarely change. One is the use of CSV (comma-separated value) files. It’s a pretty basic file format and sometimes we see other delimiters like tabs (aka TSV files) or pipe symbols but these types of files are still everywhere.

So it’s hardly surprising that people want to work with them in T-SQL as well. In our free SDU Tools for developers and DBAs, we added two functions to help: NumberOfTokens and ExtractToken.

2019-09-25

SDU Tools: List empty user tables in SQL Server

SDU Tools: List empty user tables in SQL Server

When I’ve reviewing customer databases, I often come across tables that have been created by users, yet they are completely empty. Now that might be perfectly OK but sometimes, it’s a mistake that should be cleaned up.

So, in our free SDU Tools for developers and DBAs, we added a tool that can look for user tables that are empty. No surprise, it’s called ListEmptyTables.

It takes three parameters:

@DatabaseName sysname - the database to look into @SchemasToList nvarchar(max) - a comma-delimited list of schemas to check (or ‘ALL’) @TablesToList nvarchar(max) - a comma-delimited list of tables to check (or ‘ALL’)

2019-09-18

SDU Tools: Check if an IP address is valid using T-SQL

SDU Tools: Check if an IP address is valid using T-SQL

Every now and again, I need to store IP address values in T-SQL and I want to check if the string that I’m passed is a valid IP address. So, in our free SDU Tools for developers and DBAs, we added a simple tool that works that out. It’s called IsIPv4Address.

You can tell by the name that it only works with IPv4 addresses, not IPv6.

Nothing complex. It takes a string, checks the format, and the range of octet values, and returns its verdict.

2019-09-11

SDU Tools: Execute a T-SQL command in each SQL Server database

SDU Tools: Execute a T-SQL command in each SQL Server database

I regularly run into situations where I need to execute a T-SQL command in each database on a server. The built-in Microsoft method is to call the unsupported sp_MSforeachdb, and there have been other methods over the years. None of them really worked the way that I wanted them to, so in our free SDU Tools for developers and DBAs, we added a tool that does just that. It’s called ExecuteCommandInEachDB.

2019-09-04

SDU Tools: Calculate number of days in a month using T-SQL

SDU Tools: Calculate number of days in a month using T-SQL

When I’m working with dates, I often need to calculate how many days there are in a specific date.

So, in our free SDU Tools for developers and DBAs, we added a simple tool that does just that. It’s called DaysInMonth.

It takes one parameter:

@Date date - the date to check

Nothing complex. It takes a date, and returns the number of days in the month that contains that date.

2019-08-28