--例子:
create proc p_test
@tbname sysname  --表名
as
exec('declare 游标名 cursor for select * from '+@tbname)
open 游标名close 游标名
deallocate 游标名
go