I have the following stored procedure which inserts a new registration.
I have a field in the registrations table called Guid and fieldtype uniqueidentifier.
I want to retrieve that value on insertion.
Stored procedure
I have a field in the registrations table called Guid and fieldtype uniqueidentifier.
I want to retrieve that value on insertion.
Stored procedure
Code:
USE [xforafrica]
GO
/****** Object: StoredProcedure [dbo].[AddNewRegistration] Script Date: 08/31/2012 22:03:11 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[AddNewRegistration]
(
@Firstname nvarchar(100),
@Surname nvarchar(100),
@Company nvarchar(100),
@Password nvarchar(10),
@EmailAddress nvarchar(max),
@Guid UNIQUEIDENTIFIER OUTPUT
)
AS
BEGIN
SET NOCOUNT ON;
INSERT INTO dbo.Registrations(Firstname, Surname, Company, Password, EmailAddress )
VALUES (@Firstname, @Surname, @Company, @Password, @EmailAddress)
END