Windows Azure Platform Developer Center > Azure Forums > SQL Azure — Getting Started > Run Query in Microsoft SQL Server Managment Studio
Ask a questionAsk a question
 

AnswerRun Query in Microsoft SQL Server Managment Studio

  • Wednesday, November 04, 2009 10:18 AMczekser Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hello - this Query

    SELECT

     

    @@version

    gives me this Errror: Object reference not set to an instance of an object. (Microsoft.SqlServer.Smo)

    What's wrong?

    Thank you

Answers

  • Wednesday, November 04, 2009 6:40 PMAnton Staykov Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     AnswerHas Code
    Well,
    I just tried out and figured is that "@@version" can be queried when you are connected to the MASTER database, and not your USER created DB.
    You also made me take a look at the Step-By-Step walkthrough (please make sure you have installed the latest platform training kit - OCT.2009).
    So in this latest Platform Training kit it is very clearly stated:

    Segment 1:
    Connect to the Master Database
    * Connecto to existing Master DB
    * Check connectivity by executing @@version
    * Check database count using sys.databases


    It is in very nice blue quare part of a state-flow diagram.

    And again - I just connected to the Master DB, executed:
    select @@version
    
    And got result:

    Microsoft SQL Azure (CTP) - 10.25.9027.0   Oct  8 2009 04:21:09   Copyright (c) 1988-2009 Microsoft Corporation 
    But if you try to execute the above command in cotext of user database - it will fail.
    And I do not see any ambiguousness in the instructions.

    Hope this helps.

All Replies

  • Wednesday, November 04, 2009 11:01 AMAnton Staykov Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hello,
    Current version does not support SMO, and actually has a limited set of T-SQL statements. There has been a thread about what is and what is not supported on SQL Azure:
    http://social.msdn.microsoft.com/Forums/en-US/ssdsgetstarted/thread/abc5c354-4da4-47d1-96e4-9a2e2a2d7951

    Here is a list of supported T-SQL commands:
    http://msdn.microsoft.com/en-us/library/ee336270.aspx


  • Wednesday, November 04, 2009 1:01 PMczekser Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Thanks - 
    so this says that all what's written in in "WindowsAzurPlattformKit/Demos/SQLAzureConnectiongTo - Step-by-Step Walkthrough"
    is not working?
     
    Very Strange....
     
    Walter
     
  • Wednesday, November 04, 2009 6:40 PMAnton Staykov Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     AnswerHas Code
    Well,
    I just tried out and figured is that "@@version" can be queried when you are connected to the MASTER database, and not your USER created DB.
    You also made me take a look at the Step-By-Step walkthrough (please make sure you have installed the latest platform training kit - OCT.2009).
    So in this latest Platform Training kit it is very clearly stated:

    Segment 1:
    Connect to the Master Database
    * Connecto to existing Master DB
    * Check connectivity by executing @@version
    * Check database count using sys.databases


    It is in very nice blue quare part of a state-flow diagram.

    And again - I just connected to the Master DB, executed:
    select @@version
    
    And got result:

    Microsoft SQL Azure (CTP) - 10.25.9027.0   Oct  8 2009 04:21:09   Copyright (c) 1988-2009 Microsoft Corporation 
    But if you try to execute the above command in cotext of user database - it will fail.
    And I do not see any ambiguousness in the instructions.

    Hope this helps.

  • Thursday, November 05, 2009 8:59 AMczekser Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hello Anton - thank You for your help!

    I'm connected to the master-DB!

    But now i found out that the Error shows up when i select "Result to Grid" or "Result to File".

    On "Display Estimated Executen Plan" it works! (Quey 1: Qery cost 100% select @@version)

    I have this strange behavior on to maschines (Windows 7 and Vista).

    Any idea ?

    Thank you - have a nice day