Click here to Skip to main content
15,896,269 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have one WinForm Application which using MS-SQL server As Database.

Now of course Database i have created on my PC(Developer's PC) is not available on Client PC where i will install my Application.

Then what is the best criteria or practice to Add Database at Client PC's MS-SQL server.

or
any buddy can tell where could i find script of my database created using
SERVER EXPLORER Visual-Studio 2010 so i can directly execute it on Client PC?


Please Help.... Thanks.......
Posted

1 solution

It is bad practice to install SQL server as part of your installation.
There are a couple of reasons:
0) You can only distribute SQL Server Express for copyright reasons - not SQL Server full version.
1) They may already have SQL Server installed on the network. If so, then they will presumably want to use that version.
2) If they do have SQL server installed and you start proliferating SQL server Express instances, you are going to annoy the heck out of the database administrator...
3) A single site installation of SQl Server is a lot more likely to be backed up than a number of scattered version under user control.
4) Sql server is quite complex for a "normal" user to install and administer - it is not a good idea!
5) It will destroy the primary advantage of using Sql Server over SqlCE or SQLite - multiuser access. If everyone installs their own copy of SQL server, then you will have multiple copies of your database, each used by a single person. This will cause some confusion, and (depending on how you wrote the original database) may take some considerable effort to combine into a single instance when the problem is realized.

To generate the script for your DB:
Open the SQL Management Studio, and right click on your database. Under "Tasks", select "Generate Scripts..." In the dialog that follows, press "Next" until you get to the part asking where to save it. Select somewhere sensible, and click the "Advanced" button. Look for the "Types of data to script" option (it should be at the bottom of the "General" category). Select "Schema and data". Press "OK" and "Next" until the file has been generated.
If you look at the file, it will be a complete script to regenerate your database, complete with data.
 
Share this answer
 

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