Click here to Skip to main content
15,901,035 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi folks.

From SQL Management Studio I'm able to save to a file the CREATE scripts of the tables (and other SQL objects too).

I'm wondering if exists a way to do the same from within C#.

I'm working in a generic WinForm Install/Config application (wizard like) for first time use when I deliver an application, and creating all empty tables. The general idea is to have those scripts in a directory, for this Config app read and execute all of them.

Sequence: Setup (VS Generated) -> CONFIG APP (*) -> Run app.

(*) Asking to the user where the SQL Server is, teting connections, writing config files, etc.

Thanks in advance.
Posted

This article[^] might help you.
 
Share this answer
 
Great! Thank you Ravi.

Regards from Uruguay.
 
Share this answer
 
Comments
André Kraak 20-Nov-11 12:33pm    
If you have a question about or comment on a given solution use the "Have a Question or Comment?" option beneath the solution. When using this option the person who gave the solution gets an e-mail message and knows you placed a comment and can respond if he/she wants.

Please move the content of this solution to the solution you are commenting on and remove the solution.
Thank you.
RaviRanjanKr 20-Nov-11 12:40pm    
I glad it helped you.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900