O'Reilly logo
  • Dustin Waybright thinks this is interesting:

Run the following code to create the Sales.OrdersForCountry procedure.

IF OBJECT_ID(N'Sales.OrdersForCountry', N'P') IS NOT NULL
  DROP PROC Sales.OrdersForCountry;
GO

CREATE PROC Sales.OrdersForCountry
  @country AS NVARCHAR(15)
AS

SELECT orderid, custid, empid, orderdate, shipcountry, freight
FROM Sales.Orders
WHERE shipcountry = @country;
GO

From

Cover of Training Kit (Exam 70-461): Querying Microsoft® SQL Server® 2012

Note

Creates a stored procedure where Sales.Orders is filtered on shipcountry based on the parameter @country.