x

Azure Compatibility

Seeder question: I have been asked by one of my clients to make my client application SQL Azure compatible. While I have tested and there are only a few tweaks to make, I now need to make sure that my client application can reliably determine when it is connected to SQL Azure. How might I do that?

more ▼

asked Oct 24, 2009 at 06:05 PM in Default

avatar image

Matt Whitfield ♦♦
29.5k 62 66 88

(comments are locked)
10|1200 characters needed characters left

2 answers: sort voted first

You could try

SELECT @@VERSION

Not sure what that returns on SQL Azure but you might be able to differentate using it.

James

more ▼

answered Oct 25, 2009 at 11:38 AM

avatar image

James Moore
178 3 4 6

(comments are locked)
10|1200 characters needed characters left

SQL Azure has a few extra things in it, like a system view called sys.bandwidth_usage. Therefore, you could test for its existence. This will give you 0 if there is no such view, and 1 if there is:

SELECT SIGN(ISNULL(SUM(object_id),0)) AS IsAzure
FROM sys.all_objects
WHERE name = 'bandwidth_usage'
AND schema_id = 4;
more ▼

answered Oct 25, 2009 at 08:42 PM

avatar image

Rob Farley
5.8k 16 22 28

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x22

asked: Oct 24, 2009 at 06:05 PM

Seen: 1291 times

Last Updated: Oct 24, 2009 at 06:05 PM

Copyright 2016 Redgate Software. Privacy Policy