存储过程执行的问题
我自己写了一个代码生成器,用它生成的存储过程可以在查询分析器里面成功执行
但是我把这些生成的文本作为SqlCommand的CommandText
执行ExecuteNonQuery方法就报错了
存储过程的形式为:
crerate procedure sp1
as
...
go
create procedure sp2
as
...
go
....
报错信息类似于
Line 18: Incorrect syntax near 'GO'.
Line 31: Incorrect syntax near 'GO'.
Line 41: Incorrect syntax near 'GO'.
Line 49: Incorrect syntax near 'GO'.
Line 59: Incorrect syntax near 'GO'.
Line 96: Incorrect syntax near 'GO'.
Line 124: Incorrect syntax near 'GO'.
Line 132: Incorrect syntax near 'GO'.
Line 141: Incorrect syntax near 'GO'.
这个是什么原因啊?