How to execute sql script file in Sql Server 2008
I want to execute a sql script file if user want to apply the new database changes. That script file is present on the server and if user wants to apply the new changes it just press a button i want to know how to execute that script file to a particular server database in Sql Server 2008. I want to do this in C# code file
Answers
Google c# SqlConnection, SqlCommand
Look at the example provided here
http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.aspx
Note: if the sql is in a file you will have to read the content of the file into a string first!