脚本删除SQL Azure的数据库,如果ServerName是空 [英] Script to Delete Azure SQL Database if serverName is Null

查看:303
本文介绍了脚本删除SQL Azure的数据库,如果ServerName是空的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一些solutionDB(可以说solution100),该卡在创建状态,这样的服务器名是空的,我不得不删除solutionDB如果ServerName是空。

We have some solutionDB(lets say solution100) that stuck in the creating state so the serverName would be NULL, I have to delete the solutionDB if the ServerName is null.

所以,首先我得SQL数据库和服务器名称的列表,遍历列表,然后删除solutionDB如果服务器名是NULL。

So first I have to get the list of SQL databases and server names, iterate through the list, and then delete the solutionDB if the serverName is NULL.

推荐答案

从你的描述,我猜你正在创建一个新的SQL Server的SQL数据库。但是,创造是停留在服务器级,这意味着在SQL服务器尚未建立。没有服务器,所以没有数据库尚未在所有。因此,没有什么可以删除。

From what you describe, I guess that you are creating an SQL Database with a new SQL Server. But, the creation is stuck at server level, which means the SQL server has not been created yet. There is no server, so there is no database yet at all. Hence, there is nothing you can delete.

现在,你需要做的唯一事情是在什么步骤创造卡住弄清楚。

Now, the only thing you need to do is to figure out at what step the creation is stuck.

下面是一些提示你。


  1. 登录到新的门户网站,点击浏览是在页面的左侧导航。

在这里输入的形象描述

输入审计日志以搜索。然后,点击审计日志

Enter Audit Logs to search. And then, click Audit Logs

点击过滤器,并选择你的SQL数据库的资源组,以缩小搜索范围。

Click filter, and choose the resource group of your SQL Database to narrow your search.

在这里输入的形象描述

现在,你将能看到操作列的更新SQL数据库。点击它,你将能够看到有什么不对您的SQL数据库创建。

Now, you will be able to see a column with operation Update SQL database. Click it, and you will be able to see what's wrong with your SQL database creation.

这篇关于脚本删除SQL Azure的数据库,如果ServerName是空的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆