locked
Check if connected to SqlAzure or SqlServer RRS feed

  • Question

  • Hi,

    Is it possible to check, using ADO, if we are connected to a SqlAzure DB Instance?

    Thank you

    Monday, November 1, 2010 5:35 AM

Answers

  • Hi,

    You can use the "SELECT @@Version" to know which version of SQL Azure / SQL Server you are connecting to.


    regards, wely
    • Marked as answer by claudioe Monday, November 1, 2010 6:55 AM
    Monday, November 1, 2010 6:47 AM

All replies

  • Hi,

    You can use the "SELECT @@Version" to know which version of SQL Azure / SQL Server you are connecting to.


    regards, wely
    • Marked as answer by claudioe Monday, November 1, 2010 6:55 AM
    Monday, November 1, 2010 6:47 AM
  • Hi,

    I did  and it returns the text:

    Microsoft SQL Azure (RTM) - 10.25.9445.0   Sep 16 2010 18:49:35   Copyright (c) 1988-2009 Microsoft Corporation

    So I just should check if the text contains the magic word "Azure" ;)

    OK Better than nothing,

    Thanx!

    Monday, November 1, 2010 6:55 AM
  • Yup, you can do that :)
    regards, wely
    Monday, November 1, 2010 7:07 AM