ASPNETDB Database

Procedure: aspnet_Paths_CreatePath

Description

Retrieves a path ID from the aspnet_Paths table, or creates a new one if the specified path doesn't exist.

Parameters

Name  Type  Direction 
@ApplicationId  uniqueidentifier  Input 
@Path  nvarchar  Input 
@PathId  uniqueidentifier  Input/Output 

Definition

CREATE PROCEDURE dbo.aspnet_Paths_CreatePath
@ApplicationId UNIQUEIDENTIFIER,
@Path NVARCHAR(256),
@PathId UNIQUEIDENTIFIER OUTPUT
AS
BEGIN
BEGIN TRANSACTION
IF (NOT EXISTS(SELECT * FROM dbo.aspnet_Paths WHERE LoweredPath = LOWER(@Path) AND ApplicationId = @ApplicationId))
BEGIN
INSERT dbo.aspnet_Paths (ApplicationId, Path, LoweredPath) VALUES (@ApplicationId, @Path, LOWER(@Path))
END
COMMIT TRANSACTION
SELECT @PathId = PathId FROM dbo.aspnet_Paths WHERE LOWER(@Path) = LoweredPath AND ApplicationId = @ApplicationId
END


ASP.NET 2.0 Provider Database