I would like to create my database tables in SMS then generate a script so C# can create the tables programmitically. I am currently hand coding each table at a time in visual studio. I think its far better to create the tables in SQL management studio then generate a script so c# can execute it latter on. Do you guys have any idea how to do this?
Share
In SQL Management Studio (2008) you can right click on the database, select the Tasks option, then the Generate Scripts option. A wizard will walk you through generating a script or scripts for whatever you need in your database. You can then use this scripts in C# create tables/procedures/whatever.
Edit:
The following chunk of code should execute sql scripts with GO statements in them (on SQL 2008 anyway)