2012. 2. 29. 11:27


CREATE  function [dbo].[ufn_nRow](@p_row     int)
returns  @return table(
  num int
)
as
BEGIN
declare @cnt int

set @cnt = 1
while @cnt <= @p_row
begin
insert @return(Num) values(@cnt)

set @cnt += 1
end


Return

END


--select * from [ufn_nRow](10000)

 


GO


 

'SQL' 카테고리의 다른 글

DB의 데이터를 Insert 구문으로 만들기  (0) 2012.03.16
DB 버전 보는 방법과 정보  (0) 2012.03.14
원격포트 방화벽 예외 설정 Regedit 수정  (0) 2012.03.13
Table 명세서 보기  (0) 2012.02.29
Table의 모든 컬럼 보기  (0) 2012.02.29
Posted by YKYun