Execute sql script on SQL server using C#
SQL Server 2008 R2 Express, .Net Framework 4.0, Visual Studio 2010 I'm trying to execute a SQL script from a command prompt application. I found a sample code and trying to implement the same. But the following using statements are not recognized. using Microsoft.SqlServer.Management.Common; using Microsoft.SqlServer.Management.Smo; Am I missing any assembly reference ? You likely are, you need the assemblies that are included with the SDK that comes with SQL server. Be sure you installed the SDK when you installed SQL server. (screenshot taken from a random google image search, the