Mik*_*ike 7 string sybase execute
在Sybase SQL中,我想执行包含SQL的String.
我希望这样的东西能起作用
declare @exec_str char(100)
select @exec_str = "select 1"
execute @exec_str
go
Run Code Online (Sandbox Code Playgroud)
执行| EXEC
Run Code Online (Sandbox Code Playgroud)is used to execute a stored procedure or an extended stored程序(ESP).如果批处理中有多个语句,则必须使用此关键字.
execute也用于执行包含Transact-SQL的字符串.
但是我上面的例子给出了一个错误.难道我做错了什么?