Advertisement
Advertisement
| 02.18.2008 at 06:34PM PST, ID: 23173222 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
|
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: |
WHILE (SELECT views from tblPics where PrimaryPic = 1 AND UserID = '151C99AA-280B-4FC4-974C-6839E01E4DC7') > 0
BEGIN
Update tblPics set views = views - 1 where PrimaryPic = 1 AND UserID = '151C99AA-280B-4FC4-974C-6839E01E4DC7'
Insert INTO tblGallery_Views (GalleryOwnerID, ViewerID) values('151C99AA-280B-4FC4-974C-6839E01E4DC7', NULL)
SET @Counter = @Counter + 1
IF (SELECT views from tblPics where PrimaryPic = 1 AND UserID = '151C99AA-280B-4FC4-974C-6839E01E4DC7') < 1
BREAK
ELSE
CONTINUE
END
|
| Microsoft |
| Apple |
| Internet |
| Gamers |
| Digital Living |
| Virus & Spyware |
| Hardware |
| Software |
| ITPro |
| Developer |
| Storage |
| OS |
| Database |
| Security |
| Programming |
| Web Development |
| Networking |
| Other |
| Community Support |
| 02.18.2008 at 06:49PM PST, ID: 20925320 |
| 02.18.2008 at 06:50PM PST, ID: 20925323 |
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: |
declare @userid uniqueidentifier
declare cursor tempcursor
for
select userid from users
open tempcursor
fetch next from tempcursor into @userid
while @@fetchstatus =0
begin
WHILE (SELECT views from tblPics where PrimaryPic = 1 AND UserID = @userid) > 0
BEGIN
Update tblPics set views = views - 1 where PrimaryPic = 1 AND UserID = @userid
Insert INTO tblGallery_Views (GalleryOwnerID, ViewerID) values(@userid, NULL)
SET @Counter = @Counter + 1
IF (SELECT views from tblPics where PrimaryPic = 1 AND UserID = @userid) < 1
BREAK
ELSE
CONTINUE
END
fetch next from tempcursor into @userid
end
close cursor tempcursor
deallocate cursor tempcursor
|
| 02.18.2008 at 06:54PM PST, ID: 20925345 |
| 02.18.2008 at 08:32PM PST, ID: 20925733 |
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: |
set ANSI_NULLS ON set QUOTED_IDENTIFIER ON GO ALTER PROCEDURE [dbo].[alz_Gallery_Views_Update] AS BEGIN DECLARE @UserId uniqueidentifier SET @UserId = NULL DECLARE @ViewerID uniqueidentifier SET @ViewerID = NULL DECLARE @Counter int Set @Counter = 0 -- Fix the current count problem caused by aspx page, sqlDataSource inadvertently posting twice UPDATE tblPics SET views = (views+2)/2 WHERE PrimaryPic = 1 -- backup the values in case something goes horribly wrong SELECT UserID, Views INTO dbo.Table_1 FROM tblPics Where tblPics.PrimaryPic = 1 AND tblPics.UserID is not null -- declare @userid uniqueidentifier DECLARE tempcursor CURSOR FOR SELECT UserID from tblPics where PrimaryPic = 1 OPEN tempcursor FETCH NEXT FROM tempcursor into @UserID WHILE @@FETCH_STATUS = 0 BEGIN WHILE (SELECT views from tblPics where PrimaryPic = 1 AND UserID = @UserID) > 0 BEGIN Update tblPics set views = views - 1 where PrimaryPic = 1 AND UserID = @UserID Insert INTO tblGallery_Views (GalleryOwnerID, ViewerID) values(@UserID, NULL) SET @Counter = @Counter + 1 IF (SELECT views from tblPics where PrimaryPic = 1 AND UserID = @UserID) < 1 BREAK ELSE CONTINUE END SET @Counter = 0 FETCH NEXT FROM tempcursor INTO @UserID END CLOSE tempcursor DEALLOCATE tempcursor END |