SQL ExecuteReader throws “Incorrect syntax near GO”

前端 未结 1 902
悲&欢浪女
悲&欢浪女 2021-01-21 02:47

I use a T-SQL command which I found here to get the fragmentation of my database tables. When I execute the T-SQL in the Management Studio, everything works. If I use it inside

相关标签:
1条回答
  • 2021-01-21 03:41

    GO is NOT a T-SQL command - therefore you cannot have it in T-SQL statements being executed from PowerShell.

    GO is a batch separator used by SQL Server Management Studio.

    You need to break up that statement into several individual statements yourself and execute them one by one.

    0 讨论(0)
提交回复
热议问题