Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6329773
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T17:44:23+00:00 2026-05-24T17:44:23+00:00

MSDN states that there are 4 steps in creating a server alias: In SQL

  • 0

MSDN states that there are 4 steps in creating a server alias:

  1. In SQL Server Configuration Manager, expand SQL Server Native Client Configuration, right-click Aliases, and then click New Alias.
  2. In the Alias Name box, type the name of the alias. Client applications use this name when they connect.
  3. In the Server box, type the name or IP address of a server. For a named instance append the instance name.
  4. In the Protocol box, select the protocol used for this alias. Selecting a protocol, changes the title of the optional properties box
    to Port No, Pipe Name, or Connection String.

But instead of doing it the “UI way”, is there a SQL command to do it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T17:44:24+00:00Added an answer on May 24, 2026 at 5:44 pm

    The configuration of server aliases for clients is a client configuration rather than a SQL server configuration. As such there’s no SQL command to create one, much the same as there is no SQL command to create an ODBC connection.

    You can script the configuration using WMI through powershell, the place to start is:
    http://msdn.microsoft.com/en-us/library/ms179354.aspx
    and http://msdn.microsoft.com/en-us/library/microsoft.sqlserver.management.smo.wmi.aspx

    Here is a powershell example using wmi to create an alias

    # List existing aliases
    Get-WmiObject -Namespace 'root\Microsoft\SqlServer\ComputerManagement10' -Class 'SqlServerAlias' |
        Format-Table -Property 'AliasName', 'ServerName', 'ProtocolName', 'ConnectionString'
    
    # Example script to create an alias
    $alias = ([wmiclass] '\\.\root\Microsoft\SqlServer\ComputerManagement10:SqlServerAlias').CreateInstance()
    $alias.AliasName = 'bob'
    $alias.ConnectionString = '1433' #connection specific parameters depending on the protocol
    $alias.ProtocolName = 'tcp'
    $alias.ServerName = 'example_server'
    $alias.Put() | Out-Null;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The MSDN documenation states: Indicates whether SQL Server uses the column as a ROWGUID.
I am not able to understand why Server.HtmlEncode is required? MSDN states that it
This blog http://blogs.msdn.com/sqlserverstorageengine/archive/2009/01/04/managing-tempdb-in-sql-server-tempdb-configuration.aspx states that it is a good idea to Spread TempDB across
MSDN states that String.Intern retrieves the system's reference to the specified String and String.IsInterned
The MSDN states that the method returns true if the method is successfully queued;
This article on MSDN states that you can use as many try catch blocks
I've read the MSDN article about the layouts pass, that states: When a node
Joe Duffy states in the MSDN article Using concurrency for scalability that the cost
The T-SQL MSDN page states The timestamp syntax is deprecated. This feature will be
Pretty straight forward. MSDN states that you can use ref, but not out for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.