|
alter function ufn_filler_tex_space (@my_space_row as tinyint)
returns @tbl_filler_tex_space table (wage_date_year smallint,wage_date_month tinyint,emp_name nvarchar(4),emp_idcrad varchar(18),wage_earning smallmoney,wage_out_tex smallmoney)
as
begin
while (@my_space_row < 0)
begin
insert into @tbl_filler_tex_space values(@my_space_row,null,null,null,null,null)
set @my_space_row = @my_space_row -1
end
return
end
-------------------------------
調用方法:select * from ufn_filler_tex_space(12)即可產生12個空白行
但現在的問題是,沒有達到預期效果。其中應是while語句部分出了問題,
但我還沒找到原因,請各位幫忙,指點一下?多謝! |
|