Checking if database exists or not in SQL Azure

前端 未结 3 1770
情书的邮戳
情书的邮戳 2021-01-15 01:24

Could any one please tell me how to code whether a database exists or not in sql azure ?

3条回答
  •  情书的邮戳
    2021-01-15 01:58

    Have you tried querying the sys.databases table? That should give you what you're looking for. More info here.

    Note: You'll want to run this query against the Master database. Otherwise, you'll only see the name of the current database (and Master).

提交回复
热议问题