May 27, 2009 at 4:23 pm
Steve:
Thanks.
Larry Rebich
June 16, 2009 at 6:04 am
Hello,
It is possible to install a SQL Server instance with VB but you have to call the bootstrapper of SQL Server Express ( see the blog of the SQL Server Express Team blog and all the explanations given by Mike Wachal ).
It is working for the Express Edition because it is free. For the other editions, i don't think it is possible as you have to get the product key.
SMO is not useful for the install of a SQL Server instance because the SMO dll must be deployed before to be able to use them.
SMO may be used to configurate ( or to modify the configuration settings ) a server ( SSMS is using SMO for display and modifications of the facets )
Have a nice day
June 16, 2009 at 6:40 am
Despite the attitude, I'll add my 2p worth.
You can't install from within SMO, but from within Visual Studio, you can create a process to call the SQL Express bootstapper, and pass it all the arguments it needs, or create a configuration file and tell it to use that. I believe (but haven't tried it) this will even work for other editions.
Below is a code snippet to get you started.
Proc.StartInfo.FileName = "c:\sql\SQLEXPR32_x86_ENU.exe "
Proc.StartInfo.Arguments = " /INSTANCEID=" & InstanceName
Proc.StartInfo.Arguments += " /Action=Install"
Proc.StartInfo.Arguments += " /FEATURES=SQLENGINE"
Proc.StartInfo.Arguments += " /QS"
Proc.StartInfo.Arguments += " /InstanceName=" & InstanceName
Proc.StartInfo.Arguments += " /ISSVCACCOUNT=" & """" & "NT AUTHORITY\NetworkService" & """"
Proc.StartInfo.Arguments += " /SQLSVCACCOUNT=" & """" & "NT AUTHORITY\SYSTEM" & """"
Proc.StartInfo.Arguments += " /ADDCURRENTUSERASSQLADMIN=True"
Proc.StartInfo.WorkingDirectory = "c:\sql"
Proc.StartInfo.UseShellExecute = False
bOK = Proc.Start()
One note of caution... My solution worked when testing it independently, but when I tried running this as a custom action in my own setup, it failed every time it reached the point where the bootstrapper was calling another setup.exe. I'm guessing this failure is due to the fact that you can only have one MSI running at any one time, and my MSI was eventually trying to invoke another MSI within the SQL express setup.
I know this isn't a solution, but it might save you some time by stopping you taking the same blind alley that I did.
June 16, 2009 at 6:45 am
....see the blog of the SQL Server Express Team blog and all the explanations given by Mike Wachal...
Who is Mike Wachal and how do I find his blog?
June 16, 2009 at 8:07 am
Thanks
June 16, 2009 at 8:23 am
Hello,
http://blogs.msdn.com/sqlexpress/default.aspx
Mike Wachal was belonging to the SQL Server Express Team, who , inside Microsoft, is managing the product SQL Server Express ( free version of SQL Server ) and was the main writer of this blog ( official blog for SQL Server Express team
For the installer of SQL Server Express 2008, see , for example, this link:
Have a nice day
Viewing 7 posts - 16 through 21 (of 21 total)
You must be logged in to reply to this topic. Login to reply