473,403 Members | 2,338 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,403 software developers and data experts.

how do I create new SQL 2005 instances??

hey, I wanted to programatically create a different instance on my local
computer instead of
(local)\SQLEXPRESS

I want the user to be able to type in an instance, and it will be created. I
've been reading about SMO, and although it can create tables, it can't
create instances.

how would one go about doing this?

thanks.
Jun 8 '07 #1
6 13696
hi,
check the following link:
http://msdn2.microsoft.com/en-us/lib...0(SQL.90).aspx

Regards,
Husam Al-Aáraj
www.aaraj.net
"Rogelio" wrote:
hey, I wanted to programatically create a different instance on my local
computer instead of
(local)\SQLEXPRESS

I want the user to be able to type in an instance, and it will be created. I
've been reading about SMO, and although it can create tables, it can't
create instances.

how would one go about doing this?

thanks.
Jun 8 '07 #2
thanks for that but I want to know how to do it in CODE, in visual studio, in
C#.

any help is appreciated.

"Husam Al-A''araj" wrote:
hi,
check the following link:
http://msdn2.microsoft.com/en-us/lib...0(SQL.90).aspx

Regards,
Husam Al-Aáraj
www.aaraj.net
"Rogelio" wrote:
hey, I wanted to programatically create a different instance on my local
computer instead of
(local)\SQLEXPRESS

I want the user to be able to type in an instance, and it will be created. I
've been reading about SMO, and although it can create tables, it can't
create instances.

how would one go about doing this?

thanks.
Jun 8 '07 #3
SqlConnection conn = new SqlConnection("server=(local);uid=sa;pwd=yourpass" );
SqlCommand cmd = new SqlCommand("CREATE DATABASE
MYCOOLDATABASE", conn);
conn.Open();
cmd.ExecuteNonQuery();
conn.Close();

-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net


"Rogelio" wrote:
hey, I wanted to programatically create a different instance on my local
computer instead of
(local)\SQLEXPRESS

I want the user to be able to type in an instance, and it will be created. I
've been reading about SMO, and although it can create tables, it can't
create instances.

how would one go about doing this?

thanks.
Jun 8 '07 #4
Peter Bromberg [C# MVP] wrote:
SqlConnection conn = new SqlConnection("server=(local);uid=sa;pwd=yourpass" );
SqlCommand cmd = new SqlCommand("CREATE DATABASE
MYCOOLDATABASE", conn);
conn.Open();
cmd.ExecuteNonQuery();
conn.Close();
That is a new database not a new server.

Arne
Jun 9 '07 #5
PS

"Rogelio" <Ro*****@discussions.microsoft.comwrote in message
news:5E**********************************@microsof t.com...
hey, I wanted to programatically create a different instance on my local
computer instead of
(local)\SQLEXPRESS

I want the user to be able to type in an instance, and it will be created.
I
've been reading about SMO, and although it can create tables, it can't
create instances.

how would one go about doing this?
Are you looking to create an instance that will be used by multiple users or
just by the user that creates it? A regular instance needs to be installed
from the SQL Server setup. If you are wanting an instance that is for the
local user only then you can look at User Instances which may fit your
requirements.

PS
Jun 9 '07 #6
Are you looking to create an instance that will be used by multiple users
yes
>A regular instance needs to be installed from the SQL Server setup.
really? theres no way to do it in code?
Jun 11 '07 #7

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

Similar topics

37
by: Steven Bethard | last post by:
The PEP below should be mostly self explanatory. I'll try to keep the most updated versions available at: http://ucsu.colorado.edu/~bethard/py/pep_create_statement.txt...
18
by: Steven Bethard | last post by:
I've updated the PEP based on a number of comments on comp.lang.python. The most updated versions are still at: http://ucsu.colorado.edu/~bethard/py/pep_create_statement.txt...
6
by: RAM | last post by:
Hello, Could you help me please to solve the prblem with connecting to SQL Server from .NET development environment? I have the following error: "An error has occured while establishing a...
2
by: farseer | last post by:
Hi, I have SQL Server 2005 installed on my dev system. I am working on an app that i would like to distribute SQL Server with. SQL Server EXpress edition seem to be ideal for this. My questions...
0
by: ceadtinneh | last post by:
First a bit about what I' trying to do. I'm running SQL Server 2005 Developer edition on my dev box. I've got two instances set up and am trying to set up transactional replication (with both...
4
by: cj | last post by:
Here's what I'm trying to do direct from MS (Create a Database) http://msdn2.microsoft.com/en-us/library/ms247254(VS.80).aspx Only I have VS 2005 Pro instead of Visual Web Developer. I do have...
3
by: traceable1 | last post by:
I installed the SQL Server 2005 SP2 update 2 rollup on my 64-bit server and the performance has tanked! I installed rollup 3 on some of them, but that did not seem to help. I thought it...
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...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.