请高手达人给个存储过程代码,实现如下要求,没有分了,还请仗义帮忙。
一个存储过程实现如下要求: 
 列出当前数据库下,所有内容记录不为空(就是有记录)的用户表表的内容。 
 比如: 
 use   database 
 create   proc   list_table_record 
 as 
 declare   @count   int 
 select   @count=count(*)   from   用户表--得到用户表总数 
 if   @count> 0 
          begin 
                   while   @count> 0 
                         begin 
                                  select   *   from   当前用户表   where   (select   count(*)   from   该表)> 0(就是保证该表中有记录),依次下去,取出所有用户表的记录内容 
                                  set   @count=@count-1 
                                  下一个用户表 
                         end 
             end   
 类似上面的要求,请高手帮忙解答。不胜感谢。 
------解决方案--------------------declare @sql nvarchar(100)--查询语句 
 如上语句 因为前边声明的unicode 字符串 所以赋值的时候要加上N '   
 sp_executesql是一个执行sql语句的存储过程 
 语法    
 sp_executesql [ @stmt = ] stmt 
 [  
     {, [@params=] N '@parameter_name data_type [ OUT | OUTPUT ][,...n] ' }  
      {, [ @param1 = ]  'value1 ' [ ,...n ] } 
 ]      
 其中@stmt 就是那个语句 
 @stmt参数要用unicode 字符串