declare @sql nvarchar(800)
set @sql =N'SELECT name FROM sysobjects WHERE type =U'
DECLARE tables_cursor CURSOR
FOR
exec (@sql)
或:
DECLARE tables_cursor CURSOR
FOR
exec (N'SELECT name FROM sysobjects WHERE type =U')
为何以上都报语法错误??如何解决啊?
...全文
523打赏收藏
在线等----
declare @sql nvarchar(800) set @sql =N'SELECT name FROM sysobjects WHERE type =U' DECLARE tables_cursor CURSOR FOR exec (@sql) 或: DECLARE tables_cursor CURSOR FOR exec (N'SELECT name FROM sysobjects WHERE type =U') 为何以上都报语法错误??如何解决啊?