大家帮我看看我怎么错了
ALTER proc [dbo].[pr_test]
(
@arg varchar(20)
)
as
declare @str varchar(100)
set @str='select * from t1 where arg='''+@arg+''''
exec @str
set @str='select * from t2 where arg='''+@arg+''''
exec @str
我这么写有什么错误啊
------解决方案--------------------
ALTER proc [dbo].[pr_test]
(
@arg varchar(20)
)
as
declare @str varchar(100)
set @str='select * from t1 where arg='''+@arg+''''
exec (@str)
set @str='select * from t2 where arg='''+@arg+''''
exec (@str)