How to connect sql server 2012 to excel when there is \ in server name

  • Hello,

    I am trying to connect to SQL server from excel from data wizard. My server name is like

    11111\abcd

    When i connect with above details I get error as login failed for user '<username>'

    Can anyone help me as to how can I connect SQL to excel.

    (I can use this feature when there is just an IP adress or other string named sever. This fails only when there is mixture of number and characters and a \

  • Hi

    If you are getting login failed error then it already has established connection and it fails at authorisation.

    Are you able to connect through SSMS or sqlcmd ?

    ----------------------------------------------------------------------------------------------------------------------------------------------------
    Roshan Joe

    Jeff Moden -Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • I can connect to same server thru ssms but problem occurs when i try to access it thru excel.

    Thank you for response

  • I am not aware of any such restrictions. I quickly tried with a named instance and it worked for me.

    However can you try creating an alias and use it in the wizard?

    https://msdn.microsoft.com/en-us/library/ms190445(v=sql.110).aspx

    ----------------------------------------------------------------------------------------------------------------------------------------------------
    Roshan Joe

    Jeff Moden -Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • Considering that the error is "Login failed for user '<username>'" this implies that you login details are the problem, not the fact that it has a \ in it. You wouldn't be getting that message if the server was unreachable.

    How are trying to connect to the server, by Windows Authentication or SQL Server Login? Have you checked your SQL Server logs to see if you can see the connection coming in?

    Edit: I too just tried a named instance, and didn't have any issues connecting from MS Excel 2010 to a SQL Server 2012 (tested both Windows Authention and SQL Server Login).

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • I believe it will need rights to create alias

  • I somehow believe its '\' this which has something to do. I have 2 servers one is our local and one is at onshore location. Onshore location's server name is just an IP. And I can connect to this onshore server. It does not have any '\' in it. However, the local server has it, where the login fails thru excel.

    to SSMS, both onshore and local server I can connect without any issues.

    I am connecting to SQL thru sQL server login

    Error logs for you

    Logon,Unknown,Login failed for user 'ABCD'. Reason: Password did not match that for the login provided. [CLIENT: 00.03.00.00]

    Logon,Unknown,Error: 18456<c/> Severity: 14<c/> State: 8.

  • This was removed by the editor as SPAM

  • I have following permissions.

    CONNECT SQL

    SHUTDOWN

    CREATE ENDPOINT

    CREATE ANY DATABASE

    CREATE AVAILABILITY GROUP

    ALTER ANY LOGIN

    ALTER ANY CREDENTIAL

    ALTER ANY ENDPOINT

    ALTER ANY LINKED SERVER

    ALTER ANY EXTERNAL DATA SOURCE

    ALTER ANY EXTERNAL FILE FORMAT

    ALTER ANY CONNECTION

    ALTER ANY DATABASE

    ALTER RESOURCES

    ALTER SETTINGS

    ALTER TRACE

    ALTER ANY AVAILABILITY GROUP

    ADMINISTER BULK OPERATIONS

    AUTHENTICATE SERVER

    EXTERNAL ACCESS ASSEMBLY

    VIEW ANY DATABASE

    VIEW ANY DEFINITION

    VIEW SERVER STATE

    CREATE DDL EVENT NOTIFICATION

    CREATE TRACE EVENT NOTIFICATION

    ALTER ANY EVENT NOTIFICATION

    ALTER SERVER STATE

    UNSAFE ASSEMBLY

    ALTER ANY SERVER AUDIT

    CREATE SERVER ROLE

    ALTER ANY SERVER ROLE

    ALTER ANY EVENT SESSION

    CONNECT ANY DATABASE

    IMPERSONATE ANY LOGIN

    SELECT ALL USER SECURABLES

    CONTROL SERVER

  • shy.n86 (11/23/2016)


    Logon,Unknown,Login failed for user 'ABCD'. Reason: Password did not match that for the login provided. [CLIENT: 00.03.00.00]

    Logon,Unknown,Error: 18456<c/> Severity: 14<c/> State: 8.

    You have your error there then. The password is invalid. If it was the "\" as you think, you'd never see that error, as the connection would never be made.

    Check the username and password you're supplying if using SQL Login, or check that your Windows account has permissions to access the server. This isn't a problem to do with named instances.

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

Viewing 10 posts - 1 through 9 (of 9 total)

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