October 2010
Intermediate to advanced
1920 pages
73h 55m
English
You can use .NET Framework to build a SQL stored procedure by mapping a stored procedure to a method defined in a class. You must complete the following steps:
• Create an assembly that contains the stored procedure method.
• Register the assembly with SQL Server.
• Create a stored procedure based on the assembly.
In this section, we create two stored procedures with .NET Framework. The first stored procedure, named GetRandomRow(), randomly returns a single row from a database table. The second stored procedure, GetRandomRows(), randomly returns a set of rows from a database table.