Ryan Randall

Creating a Script from a Stored Procedure

Ryan demonstrates how he arrived at a solution that allows you to create scripts from a stored procedure using SQL-DMO. If you get interested in DMO, we've got quite a bit of additional content here on the site to help you get going! Ryan is a new author here on the site, please take a minute to read his article, add a comment, maybe just say hello.

5 (1)


16,570 reads

Copy Permissions for a database

Copies the permissions from an existing database user to a new database user.Usage:exec copy_permissions_for_database 'From_User', 'To_User'* From_User must exist in the database.* To_User must not exist in the database.* To_User must exist as a login on the server.I used http://www.sqlservercentral.com/columnists/awarren/sqlpermissionspublicrole_2.asp as a starting point.

5 (1)


1,661 reads

Multiple Replace

Like the replace function, but can replace more than 1 value at a time.e.g. select dbo.multiple_replace('hello', 'e', '1', default) gives 'h1llo'.  Equivalent to: select replace('hello', 'e', '1')e.g. select dbo.multiple_replace('hello world', 'e;w;ld', '1;2;END', default) gives 'h1llo 2orEND'e.g. select dbo.multiple_replace('hello world', 'e$w$ld', '1$2$END', '$') gives 'h1llo 2orEND'

5 (1)


368 reads

Table of Numbers

A user-defined function that returns a table of numbers between a and b (using the most efficient way I can think of).e.g.  select * from table_of_numbers(1, 4) gives a table with rows 1, 2, 3 and 4.

5 (1)


125 reads


Schema evolution solved using Delta Lake & Databricks


Don’t know about you, but one of my least favourite data pipeline errors is...

Understanding Azure Geo-Redundant Storage


While at PASS Summit 2019, I gave a session on designing Azure Disaster Recovery...

Prompt in ADS


Ever since VS Code and Azure Data Studio came out, people have been asking...

Read the latest Blogs


Licencing Information

By Wecks

Hi Guys, I have the following question I am hoping that you guys can...

Countermeasure to stop forum spam bots

By jonas.gunnarsson 52434

There is a lot of spam from time to time. Is it possible to...

Query using fifo

By jsshivalik

Hi I have below Data . Using Fifo i want to display output Code...

Visit the forum


SQL Server Q&A from the SQLServerCentral community

Get answers