Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / June 2007

Tip: Looking for answers? Try searching our database.

how do I create new SQL 2005 instances??

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rogelio - 08 Jun 2007 18:51 GMT
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?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.