From the course: Complete Guide to Advanced SQL Server

Unlock the full course today

Join today to access over 24,400 courses taught by industry experts.

Challenge: Write a stored procedure

Challenge: Write a stored procedure - SQL Server Tutorial

From the course: Complete Guide to Advanced SQL Server

Challenge: Write a stored procedure

Turning Python scripts into a parameterized stored procedure is such a useful technique that I've made it the topic of the last challenge for this course. In the exercise files for Chapter 5 is a file called ChallengeFour-Start.txt. It contains a pre-written Python script that will generate a list of 10 randomly selected cities from the Wide World Importers database. In fact, we saw it as the solution of a previous challenge. Your goal this time is to turn this script into a stored procedure that will allow the end user to control how many cities it returns. This challenge should take about five minutes to complete, and I'll share my solution in the next movie.

Contents