0

Is there a simple way to code in c# to get the list of Sql Azure databases in a Windows Azure server?

Thanks Martin

1
  • Just in case you're interested, you can do this action from PowerShell fairly easily - I just documented how in this answer. Commented Jul 11, 2013 at 5:57

1 Answer 1

2

To list databases on a server, you can query the sys.databases table in the master database. You can use any data access framework you like to query this table, such as Entity Framework (http://msdn.microsoft.com/en-us/library/bb399572.aspx).

You can also list all servers under your subscription using the Management API (http://msdn.microsoft.com/en-us/library/windowsazure/gg715269).

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks. However the only tables that I see in the master database are sysdac_history_internal and sysdac_instances_internal. Am I looking in the right place?
Sorry, I meant sys.databases view (not table). Try "SELECT * FROM sys.databases" in SQL Server Management Studio. It should work. You can refer to msdn.microsoft.com/en-us/library/windowsazure/ff951625.aspx for more information.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.