当前位置: 代码迷 >> Sql Server >> 查询到的 @F1 是条Insert语句,如何样才能使用!
  详细解决方案

查询到的 @F1 是条Insert语句,如何样才能使用!

热度:83   发布时间:2016-04-27 20:26:17.0
查询到的 @F1 是条Insert语句,怎么样才能使用!!!
create     proc   spInsertTableSQL
as
DECLARE   xCursor   CURSOR   FOR
select   String   from   testdb
declare   @F1   varchar(4000)
OPEN   xCursor
FETCH   xCursor   into   @F1
WHILE   @@FETCH_STATUS   =   0
BEGIN
execute   @F1
        FETCH   NEXT   FROM   xCursor   into   @F1
END
CLOSE   xCursor
DEALLOCATE   xCursor
go

查询到的 @F1 是条Insert语句,怎么样才能使用!!!

------解决方案--------------------
exec(@F1)
  相关解决方案