O'Reilly logo

Microsoft Visual Studio 2015 Unleashed, Third Edition by Mike Snell, Lars Powers

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating a Stored Procedure in C#

Add a stored procedure item to your database project by right-clicking the project and selecting Add, New Item. From the Add New Item dialog, you select the SQL CLR C# category and then the SQL CLR C# Stored Procedure project item, as shown in Figure 13.29. Let’s name the stored procedure UpdateEmployeeLogin.

Image

FIGURE 13.29 Adding a C# stored procedure.

A new class is added to the project. Listing 13.1 shows the base code that shows up within the new class file. You can add your custom code to the static void routine UpdateEmployeeLogin.

Note

Earlier versions of Visual Studio had a separate project type (SQL ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required