473,397 Members | 1,969 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

SQL DB install vie C#

Hello,

I have this development DB (MS SQL 2k) and I want to make a installer which
creates that DB on to customer's given server. Now my problem is 1) how to
do it? 2) what things I have to take care which doing it (e.g. how I will
login into customer's DB and create DB and users and give ownership)

Thanks for the help,

Pohihihi
Nov 16 '05 #1
4 1094
hi
Here are some points for doing that programmaticaly. Alteranatively you may
go for something other like DMO or its like.
Listed out are some major steps..

1. Check existence of SQL Server in clients' machine.

2. Connect with that server. (to master database)

3. Create a new database YourDb

4. Choose a location to save YourDb_Data and YourDb_Log

You may need to do checking of free space, and etc. Alternatively, you
may choose the default location as set by
SQL Server. You require some additional logic to find them out.

4.Copy the YourDbBackup to user's machine. (BackupLocPath )

5. Restore this BackupFile as YourDb

the query will be something like this

sQry = "RESTORE DATABASE YourDb FROM " & _
"disk='" & BackupLocPath & "\ YourDbBackup' With Move " & _
"'YourDB_Data' to '" & LocationPath & "'YourDB_Data.MDF', Move " & _
"'YourDB_Log' to '" & LocationPath & "'YourDB_Log.LDF'"

Ansil
Dimensions
Technopark
Trivandrum

"Pohihihi" wrote:
Hello,

I have this development DB (MS SQL 2k) and I want to make a installer which
creates that DB on to customer's given server. Now my problem is 1) how to
do it? 2) what things I have to take care which doing it (e.g. how I will
login into customer's DB and create DB and users and give ownership)

Thanks for the help,

Pohihihi

Nov 16 '05 #2
Hi Ansil,

Thanks for the email but I know these steps. Only thing I do not know is how
in code.
"Ansil MCAD" <An*******@discussions.microsoft.com> wrote in message
news:BC**********************************@microsof t.com...
hi
Here are some points for doing that programmaticaly. Alteranatively you
may
go for something other like DMO or its like.
Listed out are some major steps..

1. Check existence of SQL Server in clients' machine.

2. Connect with that server. (to master database)

3. Create a new database YourDb

4. Choose a location to save YourDb_Data and YourDb_Log

You may need to do checking of free space, and etc. Alternatively, you
may choose the default location as set by
SQL Server. You require some additional logic to find them out.

4.Copy the YourDbBackup to user's machine. (BackupLocPath )

5. Restore this BackupFile as YourDb

the query will be something like this

sQry = "RESTORE DATABASE YourDb FROM " & _
"disk='" & BackupLocPath & "\ YourDbBackup' With Move " & _
"'YourDB_Data' to '" & LocationPath & "'YourDB_Data.MDF', Move " & _
"'YourDB_Log' to '" & LocationPath & "'YourDB_Log.LDF'"

Ansil
Dimensions
Technopark
Trivandrum

"Pohihihi" wrote:
Hello,

I have this development DB (MS SQL 2k) and I want to make a installer
which
creates that DB on to customer's given server. Now my problem is 1) how
to
do it? 2) what things I have to take care which doing it (e.g. how I will
login into customer's DB and create DB and users and give ownership)

Thanks for the help,

Pohihihi

Nov 16 '05 #3
I guess you need to reference SQLDMO and use it

Pohihihi wrote:
Hi Ansil,

Thanks for the email but I know these steps. Only thing I do not know is how
in code.
"Ansil MCAD" <An*******@discussions.microsoft.com> wrote in message
news:BC**********************************@microsof t.com...
hi
Here are some points for doing that programmaticaly. Alteranatively you
may
go for something other like DMO or its like.
Listed out are some major steps..

1. Check existence of SQL Server in clients' machine.

2. Connect with that server. (to master database)

3. Create a new database YourDb

4. Choose a location to save YourDb_Data and YourDb_Log

You may need to do checking of free space, and etc. Alternatively, you
may choose the default location as set by
SQL Server. You require some additional logic to find them out.

4.Copy the YourDbBackup to user's machine. (BackupLocPath )

5. Restore this BackupFile as YourDb

the query will be something like this

sQry = "RESTORE DATABASE YourDb FROM " & _
"disk='" & BackupLocPath & "\ YourDbBackup' With Move " & _
"'YourDB_Data' to '" & LocationPath & "'YourDB_Data.MDF', Move " & _
"'YourDB_Log' to '" & LocationPath & "'YourDB_Log.LDF'"

Ansil
Dimensions
Technopark
Trivandrum

"Pohihihi" wrote:

Hello,

I have this development DB (MS SQL 2k) and I want to make a installer
which
creates that DB on to customer's given server. Now my problem is 1) how
to
do it? 2) what things I have to take care which doing it (e.g. how I will
login into customer's DB and create DB and users and give ownership)

Thanks for the help,

Pohihihi


Nov 16 '05 #4
You are creating a database so you should use CREATE DATABASE statement.

--
Regards,

Deepak
[I Code, therefore I am]
"Uri Dor" <ta****@newsgroups.nospam> wrote in message
news:%2******************@TK2MSFTNGP12.phx.gbl...
I guess you need to reference SQLDMO and use it

Pohihihi wrote:
Hi Ansil,

Thanks for the email but I know these steps. Only thing I do not know is
how in code.
"Ansil MCAD" <An*******@discussions.microsoft.com> wrote in message
news:BC**********************************@microsof t.com...
hi
Here are some points for doing that programmaticaly. Alteranatively you
may
go for something other like DMO or its like.
Listed out are some major steps..

1. Check existence of SQL Server in clients' machine.

2. Connect with that server. (to master database)

3. Create a new database YourDb

4. Choose a location to save YourDb_Data and YourDb_Log

You may need to do checking of free space, and etc. Alternatively,
you
may choose the default location as set by
SQL Server. You require some additional logic to find them out.

4.Copy the YourDbBackup to user's machine. (BackupLocPath )

5. Restore this BackupFile as YourDb

the query will be something like this

sQry = "RESTORE DATABASE YourDb FROM " & _
"disk='" & BackupLocPath & "\ YourDbBackup' With Move " & _
"'YourDB_Data' to '" & LocationPath & "'YourDB_Data.MDF', Move " & _
"'YourDB_Log' to '" & LocationPath & "'YourDB_Log.LDF'"

Ansil
Dimensions
Technopark
Trivandrum

"Pohihihi" wrote:
Hello,

I have this development DB (MS SQL 2k) and I want to make a installer
which
creates that DB on to customer's given server. Now my problem is 1) how
to
do it? 2) what things I have to take care which doing it (e.g. how I
will
login into customer's DB and create DB and users and give ownership)

Thanks for the help,

Pohihihi



Nov 16 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Yun Guan | last post by:
Hello mysql gurus, I am trying to run perl on mysql database on Red Hat box. I want to install DBI and DBD:mysql using CPAN: perl -MCPAN -e shell cpan>install DBI The above succeeded, but...
1
by: Peter Hartmann | last post by:
How do I influence the platform type during install? Could you look at this and tell me what I'm doing wrong? It's still using information from get_platform instead of using my preference. #...
3
by: Jeremy S. | last post by:
On my dev machine (XP/Pro with VS.NET 2003) I have been developing a Windows Service and installing it on the local machine by opening the Visual Studio Command Prompt and then executing . Now I...
7
by: p | last post by:
WE had a Crystal 8 WebApp using vs 2002 which we upgraded to VS2003. I also have Crystal 9 pro on my development machine. The web app runs fine on my dev machine but am having problems deploying....
12
by: Matt Fielder | last post by:
I tried to install SP1, and it appears to have just stopped somewhere part way through. It was "collecting information" (for a long time, slow progress bar) --- then suddenly it stopped.... no...
5
by: Ajith Menon | last post by:
I have to install .NET framework 3.0. I already have .NET Framework 1.1 installed on my machine. I don't want to remove framework 1.1 since some of the critical applications are using it. While...
3
by: Jason Madison | last post by:
My SP1 install seemed to want to keep repeating the install. I spent 4 hours running the install, then it ran again (I got the message up saying it had finished, then it started again). I didn't...
1
by: Sorin Schwimmer | last post by:
Hi All, After a disaster in which I lost my whole harddrive, I decided to install the newest everything that I use. I put the latest Gentoo Linux, with gcc 4.1.1, installed tcl/tk 8.4.14 and...
1
by: =?Utf-8?B?Qi5BaGxzdGVkdA==?= | last post by:
Hi all, This is something that I have been toying with for about a week now. What I want to achieve is Install a Service with Customised parameters (using InstallUtil.exe) for User Name. Example...
3
by: Jean-Marc Blaise | last post by:
Hi, I've been trying for 2 hours to install in silent mode a DB2 9 runtime client. Why didn't you make this process as simple as for the CLIENT install ? It is not the same setup command, you...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.