반응형
/********************************************************************************************
-- Title : [2k] 자동 시작 프로시저 메타 확인
-- Reference : dbrang.tistory.com
-- Key word : 자동 시작 프로시저 procoption startup ExecIsStartup
********************************************************************************************/
use master
go
create table ttt
( id int not null identity
, strt_dt datetime not null
)
create proc up_ttt
as
set nocount on
insert into dbo.ttt values (getdate())
go
exec up_ttt;
go
select * from dbo.ttt;
go
sp_procoption 'dbo.up_ttt', 'startup', 'true'
go
--
-- SQL Server Restart.
--

select * from dbo.ttt; -- Restart 후 1건 추가됨

-- 자동 시작 프로시저 확인
select ObjectProperty(id, 'ExecIsStartup') "IsStartup", name from sysobjects
where xtype = 'p'
and name = 'up_ttt'

반응형

+ Recent posts