It’s me

December 9, 2008

간단한 임시 테이블 사용 Stored procedure

Filed under: SQL SERVER — Tags: , , , — rothmans @ 10:45 am

create procedure temporay_table_test
as
begin
declare @frdate datetime
declare @cnt int
create table #tempx (idx int identity (1,1), frdate datetime)

set @cnt = 1
while @cnt < 5
begin
waitfor delay ‘00:00:01′ — 시간 delay
set @frdate = getdate()
set @cnt = @cnt + 1
insert into #tempx (frdate) values (@frdate)
end
select * from #tempx
end

if object_id (‘tempdb..#tempx’) is not null drop table #tempx

No Comments Yet »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

Blog at WordPress.com.