SyntaxFix
Write A Post
Hire A Developer
Questions
For anyone still having the problem. You could use official Microsoft SMO
https://docs.microsoft.com/en-us/sql/relational-databases/server-management-objects-smo/overview-smo?view=sql-server-2017
using (var connection = new SqlConnection(connectionString)) { var server = new Server(new ServerConnection(connection)); server.ConnectionContext.ExecuteNonQuery(sql); }