Can we Create sql server instance through script?

  • Hi,

    I am using SQL server 2008 standard edition. Is there a way to create a new server Instance by a script except the default instance.?

    Thanks.

    Regards,
    Jigneshal
    " Stretch Your Limit Little Beyond Your Limit....! "
    😎

  • Yes, run setup.exe from cmd

    http://msdn.microsoft.com/en-us/library/ms144259%28v=sql.100%29.aspx

    eg: Setup.exe /qs /Action=Install /Features=SQLEngine /InstanceName=NewInstanceName /SQLSYSADMINACCOUNTS="domain\sysadmin" /IAcceptSQLServerLicenseTerms

  • Still not clear that, is there any way to create it using scipt?

    Regards,
    Jigneshal
    " Stretch Your Limit Little Beyond Your Limit....! "
    😎

  • Now I don't know what is not clear in adding the setup.exe with proper parameters in script. What kind of script do you mean? What do you want to achieve?

  • via TSQL, the best answer is no, you cannot install a new SQL instance via TSQL.

    it has to be done from the operating system side, with the example parameters supplied above, as a .cmd or .bat file, or simply inline in a cmd window.

    there are edge cases, where if you are running the right user for the SQL service, you could call xp_cmdshell and it might work, but it's not worth the trouble to track down all the errors and issues to make it work.

    additionally, it is exceedingly rare you need to install additional instances if you already have an instance in place, so I'm wondering what the real issue is on this question.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply