帮我解决一下这个问题,我有2张表 假设一张是aa表里面有2个字段一个是id另一个字段是tablename
另一张表表的名称就是根据id检索出来的表,现在我想通过id来检索tablename下面的表的内容该怎么写存储过程
另一张表表的名称就是根据id检索出来的表,现在我想通过id来检索tablename下面的表的内容该怎么写存储过程
解决方案 »
- c#中,数字型有“定点小数型”吗,double型是浮点型,精度高吗?
- C# winform checkbox 两个树形结构的操作
- c#识别数字的问题?
- 求成熟B/S OA系统一套,要求功能简单实用
- 求一个同步解决方案(说思路就行)
- 修改密码小问题
- API函数PostMessage在WindowsXP下能正常运行,但在Windows98下面的不能正常运行?
- gridview中checkbox的遍历,只能访问到第一行,请帮忙!
- 请各位兄弟指教ado.net + access +windowsapplication 中如何访问带密码的access数据库啊
- 有没有公司在用.net开发~!!
- 请大家帮一下我,在C#下怎样读取Schema的指定标记和内容
- C#技术联盟群,看到上面的群已经满,再一个新的群,4912517,新熟手欢迎来讨论!
@id int
as
begin
declare @str varchar(20)
if exists(select * from aa where id=@id)
select @str=tablename from aa where id=@id
select * from @str
end
@id int
as
begin
declare @str varchar(20)
if exists(select * from aa where id=@id)
select @str=tablename from aa where id=@id
exec ('select * from '+@str)
end