假設今天是19號, 執行存儲過程 EXEC PROC_Test_IF_BEGIN END 得到什麼? 答案:a19 ...
USE [DB_NAME] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER PROCEDURE [DBO].[PROC_TEST_IF_BEGIN END] AS BEGIN SET NOCOUNT ON; IF (DAY(GETDATE())=1) BEGIN PRINT 'A' END IF (DAY(GETDATE())=19) BEGIN PRINT 'A19' END IF (DAY(GETDATE())=20) BEGIN PRINT 'AAAA20' END IF OBJECT_ID('TEMPDB..#BASE') IS NOT NULL BEGIN PRINT 'B' END END
假設今天是19號, 執行存儲過程 EXEC PROC_Test_IF_BEGIN END
得到什麼?
答案:a19