-
Notifications
You must be signed in to change notification settings - Fork 751
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix OutputCacheAddItem stored procedure
Fix OutputCacheAddItem stored procedure dublicate primarykey check
- Loading branch information
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
DNN Platform/Website/Providers/DataProviders/09.10.03.SqlDataProvider
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'{databaseOwner}{objectQualifier}OutputCacheAddItem') AND type in (N'P', N'PC')) | ||
DROP PROCEDURE {databaseOwner}{objectQualifier}OutputCacheAddItem | ||
GO | ||
|
||
CREATE PROCEDURE {databaseOwner}[{objectQualifier}OutputCacheAddItem] | ||
@ItemId Int, | ||
@CacheKey VarChar ( 36), | ||
@Data nVarChar(Max), | ||
@Expiration DateTime | ||
AS | ||
BEGIN | ||
IF NOT EXISTS (SELECT CacheKey from {databaseOwner}{objectQualifier}OutputCache where CacheKey = @CacheKey) | ||
begin | ||
INSERT INTO dbo.OutputCache | ||
(ItemId, | ||
CacheKey, | ||
Data, | ||
Expiration | ||
) VALUES | ||
(@ItemId, | ||
@CacheKey, | ||
@Data, | ||
@Expiration | ||
) | ||
end | ||
ELSE UPDATE {databaseOwner}{objectQualifier}OutputCache Set Data = @Data, Expiration = @Expiration Where CacheKey = @CacheKey | ||
END | ||
|
||
GO |