Ive got a couple of scripts that I need to run on my databse. So I have a few questions.
Im simply using Connection, CommandText,CommandType and CommandTimeout when opening a connection to the databse.
First question - Does anyone know if through this method, I can create permantent tables, not temporary tables?
Secondly - How would I run this file? Could I just set the file to be a parameter, and in the query run the parameter?
Thanks
You can do anything in a .NET SQL connection that you could do in a SQL script. As far as "running a file", you would need to load the file text into memory and execute the loaded text as a single command.
We do something similar in our application. Our database scripts are stored in SQL scripts. We load each file sequentially from disk into memory and execute it.