how do I find the IP of the 2005 sql server instance?

  • Hi guys,

    I need to find the IP address of an INSATNCE of sql server 2005. When I open sql server management studio,it writes ADMIN-PC (SQL Server 9.0.1399 - sa).Is that the instance??

    But I have also a SQL 2005 instance installed. I need to use the IP address in a connection string as follows (using it to connect to an sql sever remote database .mdf from a cradled amulator)

    I have no idea how to find the IP address fo the 2005 instance. ipconfig wont' do that.

    I tried to change my connexion string to :

    string adr="SELECT @@SERVERNAME AS 'Server Name';";

    string sConnection = "Data Source=" + adr + ",1433;Initial Catalog=GMAO;User ID=sa;Password=sa;";(My problem is the @IP of my sql server instance that I should write in Data source field)

    Thanks if u clarify me

    Thanks

  • marwenG (5/8/2010)


    Hi guys,

    I need to find the IP address of an INSATNCE of sql server 2005. When I open sql server management studio,it writes ADMIN-PC (SQL Server 9.0.1399 - sa).Is that the instance??

    But I have also a SQL 2005 instance installed. I need to use the IP address in a connection string as follows (using it to connect to an sql sever remote database .mdf from a cradled amulator)

    I have no idea how to find the IP address fo the 2005 instance. ipconfig wont' do that.

    I tried to change my connexion string to :

    string adr="SELECT @@SERVERNAME AS 'Server Name';";

    string sConnection = "Data Source=" + adr + ",1433;Initial Catalog=GMAO;User ID=sa;Password=sa;";(My problem is the @IP of my sql server instance that I should write in Data source field)

    Thanks if u clarify me

    Thanks

    I think you are little confused with instances and ip addresses. There is only one IP address per server where as you can have multiple instances residing on one physical server.

    What you need to do is to find out whether you are connecting to the default instance or named instance.

    click on run, type services.msc, scroll down to see list of services with name starting with sql server.

    SQL Server (MSSQLSERVER) is your default Instance.

    SQL Server (<Instance Name>) is your named instance.

    now to connect to your default instance, you need to provide your machine name OR machine's IP address in the data source.

    to connect to a named instance, you need to provide machineName\InstanceName or IPAddress\InstanceName in the data source.

    hope this clarifies.



    Pradeep Singh

  • Hi,

    Thanks for the clarification.I change my strind connection to that:

    string sConnection = @"Data Source=Admin-PC\MSSQLSERVER,1433;Initial Catalog=GMAO;User ID=sa;Password=sa;";

    I turn off my Firewall.

    When running,this error appears:

    SQL server name not found:Admin-PC\MSSQLSERVER,1433

    What is the problem plzzzzzzzz???

    Thanks

  • marwenG (5/8/2010)


    Hi,

    Thanks for the clarification.I change my strind connection to that:

    string sConnection = @"Data Source=Admin-PC\MSSQLSERVER,1433;Initial Catalog=GMAO;User ID=sa;Password=sa;";

    I turn off my Firewall.

    When running,this error appears:

    SQL server name not found:Admin-PC\MSSQLSERVER,1433

    What is the problem plzzzzzzzz???

    Thanks

    As i mentioned in my previous reply, MSSQLSERVER is the name of the default instance so you dont need to mention that. Just mention the name of the pc.

    string sConnection = "Data Source=Admin-PC;Initial Catalog=GMAO;User ID=sa; Password=sa;"



    Pradeep Singh

  • Hi,

    Thanks for the clarification.I change my strind connection to that:

    string sConnection = @"Data Source=Admin-PC\MSSQLSERVER,1433;Initial Catalog=GMAO;User ID=sa;Password=sa;";

    I turn off my Firewall.

    When running,this error appears:

    Specified SQL server name not found:Admin-PC\MSSQLSERVER,1433

    What is the problem plzzzzzzzz???

    Thanks

  • pls read my previous post.



    Pradeep Singh

  • Hi ps,

    My string connection is now like that:

    string sConnection = @"Data Source=Admin-PC;Initial Catalog=GMAO;User ID=sa;Password=sa;";

    When running my program,still the same error:

    Specified sql server not found:Admin-PC

    what is the problem?

    Thanks

  • marwenG (5/8/2010)


    Hi ps,

    My string connection is now like that:

    string sConnection = @"Data Source=Admin-PC;Initial Catalog=GMAO;User ID=sa;Password=sa;";

    When running my program,still the same error:

    Specified sql server not found:Admin-PC

    what is the problem?

    Thanks

    Please open sql server management studio (SSMS) and try to login there by supplying the information you are passing in the connection string and see if you are able to connect to the sql server.



    Pradeep Singh

  • Hi ps,

    I connect to my MSQSMS without any problem and with the informations given in my string connection

    Thanks

  • May be you need to supply the provider name as well in the connection string and see if that works. is the sql server residing on the local machine?



    Pradeep Singh

  • Hi,

    My sql server is in my local computer.i follow this link to connect to my database using the emulator:

    http://netcf2.blogspot.com/2005/12/accessing-sql-server-express-from.html

    Thanks

  • I'm not a coder. If you're able to connect via SSMS, you shud be able to connect via ur application.

    I read that link u provided.

    find the IPaddress of your local machine by opening command prompt(cmd) and running ipconfig. If its local machine, you can use the IP address 127.0.0.1

    check the port number SQL Server is running as mentioned in the URL u provided.

    change the connection string to

    string sConnection = "Data Source=127.0.0.1,1433;Initial Catalog=GMAO;User ID=sa;Password=sa;";



    Pradeep Singh

  • Hi ps,

    the same error appears.:hehe:

    Thanks

  • marwenG (5/8/2010)


    Hi ps,

    My string connection is now like that:

    string sConnection = @"Data Source=Admin-PC;Initial Catalog=GMAO;User ID=sa;Password=sa;";

    When running my program,still the same error:

    Specified sql server not found:Admin-PC

    what is the problem?

    Thanks

    The problem is the "dash" in the data source (when will people learn???? NO SPECIAL CHARACTERS EXCEPT UNDERSCORES!!! NO SPACES EITHER!!!!)

    I suspect you'll need to do something like this to overcome the problem of the dash...

    string sConnection = @"Data Source=[Admin-PC];Initial Catalog=GMAO;User ID=sa;Password=sa;";

    ... but I don't know much about connection string because I don't do GUI's no-mo. 😛

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • another thing ...

    Are you sure your instance is listening at the port number you provided ??

    If I'm correct, in a connection string, if you provide the port number, it will not try to connect to the instance name, but only try to connect to that port number.

    You can find the used port number :

    - using sqlserver configuration manager (to be executed on the server itself)

    - checking the sqlinstance errorlog file (right after startup !)

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me

Viewing 15 posts - 1 through 15 (of 16 total)

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