Windows Azure Platform Developer Center >
Azure Forums
>
SQL Azure — Getting Started
>
Run Query in Microsoft SQL Server Managment Studio
Run Query in Microsoft SQL Server Managment Studio
- 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
- 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:
And got result:select @@version
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.- Proposed As Answer byAnton Staykov Wednesday, November 04, 2009 6:40 PM
- Marked As Answer byEvan BasalikMSFT, ModeratorWednesday, November 04, 2009 7:02 PM
All Replies
- 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 - Thanks -
so this says that all what's written in in "WindowsAzurPlattformKit/Demos/SQLAzureConnectiongTo - Step-by-Step Walkthrough"
is not working?
Very Strange....
Walter
- 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:
And got result:select @@version
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.- Proposed As Answer byAnton Staykov Wednesday, November 04, 2009 6:40 PM
- Marked As Answer byEvan BasalikMSFT, ModeratorWednesday, November 04, 2009 7:02 PM
- 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


