赵晓柔,广西摩托大军返乡,乐巢汇论坛
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
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
数据库SQL---数据库、基本表、视图、索引的定义、修改、删除
在 Azure CentOS VM 中配置 SQL Server 2019 AG - (上)
在 Azure CentOS VM 中配置 SQL Server 2019 AG - (下)
网友评论