Install database ms sql 2008 automatically containing all the tables, view, sps etc.using windows installer
-
22 Juli 2012 4:31
Hi,
I have searched about it very much but did not get any proper response. While searching I found an article here. But it uses sql-dmo which is not present in vs 2010 (I am using vs 2010) and also there author writes down the table structure to create it at installation time.
So what I need is that is there any good article which demonstrates about installing ms-sql database (which we have using in our application during development time), through a script file in windows installer method.
Please guide me, and please do not suggest links regarding prerequisites...
Many thanks
Semua Balasan
-
24 Juli 2012 6:53Moderator
But it uses sql-dmo which is not present in vs 2010 (I am using vs 2010) and also there author writes down the table structure to create it at installation time.
Hi sophia_asp,
What do you mean by "it uses sql-dmo which is not present in vs 2010 (I am using vs 2010) "?
If the database file included in the project, then you can set the Build Action to Content, set Copy to Output Directory to “Copy always”, rebuild the project ,right click the setup project, click add, select project, select “Content Files” in the Add Project OutputGroup dialog, and then click Ok. For more details, see http://social.msdn.microsoft.com/Forums/en-ZA/winformssetup/thread/6ab104f9-305f-49dc-ac39-401ddbb64f3f
If the database is located in the SQL Server, then please follow the steps below.
First, right click the database in the SQL Server Management, Tasks-> Generate Scripts to create a Script file.
Sceond, create a custom action to run the Script , see http://msdn.microsoft.com/en-us/library/49b92ztk
http://www.codeproject.com/Articles/10032/Deploy-SQL-Server-databases-easily-with-an-Install
Best Regards,
Bob Wu [MSFT]
MSDN Community Support | Feedback to us
- Ditandai sebagai Jawaban oleh Bob Wu-MTMicrosoft Contingent Staff, Moderator 09 Agustus 2012 7:05