You are here:   Blog
Register   |  Login

Blog Archive:

* Can be used in order to search for older blogs Entries

Search in blogs

Blog Categories:

* Can be used in order to search for blogs Entries by Categories

Blog Tags:

* Can be used in order to search for blogs by keywords


Awared MVP


Microsoft® Community Contributor 

Microsoft® Community Contributor

 Read this before you use the blog! Maximize

Recent Entries


Written by: ronen ariely
04/07/2017 16:03 RssIcon

We can use the built-in SQL Server Management Studio wizard in order to enable Stretch on the database and configure the table which will be stretched to the Azure on the same time. In this short blog, I want to show example (again) why you should not use wizards.


In order to start the wizard, right click on the database in the Object Explorer window -> Task -> Stretch -> Click on Enable

For more information on running the Enable Database for Stretch Wizard check this tutorial.

During the procedure, we need to select if we want to stretch the “entire Table” or “Choose Rows”, which meant to filter rows that we want to stretch to the azure remote server.

The option of “Choose Rows” allows to configure a “select query”, which will be used for the “Stretch filter function”, but in order to move to the next step, we must first click on “Check” button to confirm that our query fit.

This “Check” does not work well, and if there are no rows at this time, which fit the condition in the query, then the “check” failed and the test reports "0 Rows returned. Cannot create a predicate with these values." if there are not fitting rows.

This mean for example, that we cannot configure stretch on empty table or any other condition which does not have rows at this time! It is well documented, but In my opinion this is a bug in design.

As you can see in the image above, the button “Done” is grayed and we cannot move to the next step, simply because my table does not include any row with id greater than 100.


Using the SSMS Stretch Database wizard does not fit for cases that the table does not include at this time data which fit the stretch condition. The solution is simply to use T-SQL queries, and please forget about the Stretch Database wizard, as I usually recommend regarding most wizards.

Resources and more to read

>> You can download the code from one of my lectures, which include full demo of using stretch database.

>> Get started by running the Enable Database for Stretch Wizard - Microsoft documentation.

>> Enable Stretch Database for a database – Microsoft documentation.

>> Manage and troubleshoot Stretch Database – Microsoft Documentation.