---
title: "How to get a list all databases?"  
description: "How to get a list all databases?"  
author: "Amit Singh"  
published: 2010-11-09  
updated: 2020-09-17  
canonical: https://www.mindstick.com/interview/224/how-to-get-a-list-all-databases  
category: "mssql server"  
tags: ["mssql server"]  
reading_time: 1 minute  

---

# How to get a list all databases?

we get a list of all databases on the server by query the "sys.databases"\
\
for example\
\
SELECT name, database_id FROM sys.databases\

## Answers

### Answer by Amit Singh

we get a list of all databases on the server by query the "sys.databases"\
\
for example\
\
SELECT name, database_id FROM sys.databases\


---

Original Source: https://www.mindstick.com/interview/224/how-to-get-a-list-all-databases

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
