当前位置: 代码迷 >> Sql Server >> 看看这个存储过程有什么有关问题
  详细解决方案

看看这个存储过程有什么有关问题

热度:89   发布时间:2016-04-27 18:39:05.0
各位大哥看看这个存储过程有什么问题
请问一个各位大哥,看看我的这个存储过程有什么错误
create proc TableTerm
@TableName char(25),
@TableField char(20),
@TableTerm char(20),
@TableTerms char(20)
as
begin
declare @Tab char(100)
set @Tab=('select [email protected]+'from [email protected]+' where [email protected]+' = [email protected])
exec(@exec)
end
Go

------解决方案--------------------
SQL code
declare @Tab char(100)set @Tab=('select [email protected]+' from [email protected]+' where [email protected]+' = [email protected])exec(@Tab)
------解决方案--------------------
1、from前面加空格
2、exec(@exec)改为exec(@Tab)

------解决方案--------------------
@exec没有声明
------解决方案--------------------
[email protected],这语句就是错的,因为没加引号
  相关解决方案