O'Reilly logo

Pro ASP.NET SignalR: Real-Time Communication in .NET with SignalR 2.1 by Darren White, Keyvan Nayyeri

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

Listing 10-73. CreateUser Stored Procedure

USE [GroupBrush]GOCREATE Procedure [dbo].[CreateUser](@Name nchar(100),@Password nchar(255),@UserId int output)AsBeginDeclare @ReturnValue int = -1If Exists(Select 1 From dbo.Users Where Name = @Name)Begin        Set @ReturnValue = 1EndElseBegin        Declare @UserIds Table (userId int)        INSERT INTO [dbo].[Users]                           ([Name]                           ,[Password])                Output Inserted.UserId Into @UserIds(userId)                 VALUES                           (@Name                           ,@Password)        Select @ReturnValue = 0, @UserId = userId From @UserIdsEndReturn @ReturnValueEndGO

Listing 10-74. ValidateUser Stored Procedure

USE [GroupBrush]GOCREATE ...

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