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.
Husam Al-A''araj - 08 Jun 2007 19:55 GMT
hi,
check the following link:
http://msdn2.microsoft.com/en-us/library/ms179530(SQL.90).aspx
Regards,
Husam Al-Aáraj
www.aaraj.net
> hey, I wanted to programatically create a different instance on my local
> computer instead of
[quoted text clipped - 7 lines]
>
> thanks.
Rogelio - 08 Jun 2007 20:01 GMT
thanks for that but I want to know how to do it in CODE, in visual studio, in
C#.
any help is appreciated.
> hi,
> check the following link:
[quoted text clipped - 15 lines]
> >
> > thanks.
Peter Bromberg [C# MVP] - 08 Jun 2007 21:24 GMT
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
> hey, I wanted to programatically create a different instance on my local
> computer instead of
[quoted text clipped - 7 lines]
>
> thanks.
Arne Vajhøj - 09 Jun 2007 01:23 GMT
> 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
PS - 09 Jun 2007 18:09 GMT
> hey, I wanted to programatically create a different instance on my local
> computer instead of
[quoted text clipped - 6 lines]
>
> 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
Rogelio - 11 Jun 2007 20:51 GMT
> 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?