Quote:using Microsoft.SqlServer.Management.Common;
FileInfo file = new FileInfo("C:\\myscript.sql"); string script = file.OpenText().ReadToEnd(); Server server = new Server(new ServerConnection(conn)); server.ConnectionContext.ExecuteNonQuery(script);
references using Microsoft.SqlServer.Management.Smo; using Microsoft.SqlServer.Management.Common; ------------------------------------------------- dll files are Microsoft.SqlServer.ConnectionInfo.dll Microsoft.SqlServer.Smo.dll
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)