IF:
CREATE PROCEDURE spTestDavid
@userID int
AS
IF EXISTS(SELECT * FROM UserDavid WHERE ID = @userID)
PRINT 'User EXISTS: ' + CAST(@userID AS VARCHAR(32))
ELSE
PRINT 'User CANNOT found' + CAST(@userID AS VARCHAR(32))
WHILE:
CREATE PROCEDURE spTestDavid2
@COUNTER int
AS
WHILE @COUNTER > 0
BEGIN
EXEC spTestDavid @userID = @COUNTER
SET @COUNTER = @COUNTER - 1;
END
EXEC spTestDavid2 @COUNTER = 30
香兰叶 Pandan (Pandanus amaryllifolius) <->
// Proudly powered by Apache, PHP, MySQL, WordPress, Bootstrap, etc,.