Created
January 2, 2018 15:23
-
-
Save bhdryrdm/c9824fa6a9f3e402f048d400c91cac03 to your computer and use it in GitHub Desktop.
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
/* | |
* Bu trigger kullanıcı tablosuna 5 kayıttan sonra 5 kayıt arasındaki 3.kullanıcıyı silmektedir. | |
* Yeni eklenen kullanıcı 5. kayıt olarak eklenmektedir. | |
*/ | |
IF (SELECT Count(UserID) FROM XSS_User) > 5 | |
Delete FROM XSS_User | |
Where UserID IN ( | |
SELECT TOP 1 UserID | |
FROM ( | |
SELECT UserID, ROW_NUMBER() | |
OVER (ORDER BY(UserID)) | |
AS ROW FROM dbo.XSS_User | |
) | |
AS PAGED WHERE ROW > 2 | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment