how do I create new SQL 2005 instances??

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
thanks for that but I want to know how to do it in CODE, in visual studio, in
C#.

any help is appreciated.
 
Peter said:
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
 
Rogelio said:
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
 
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?
 
Back
Top