‘master..sysdatabases’ SQL Server syntax equivalent in MySQL Code Answer

Hello Developer, Hope you guys are doing great. Today at Tutorial Guruji Official website, we are sharing the answer of ‘master..sysdatabases’ SQL Server syntax equivalent in MySQL without wasting too much if your time.

The question is published on by Tutorial Guruji team.

I am converting an SQL Server stored procedure to MySQL and there is the below code line in one stored procedure:

declare c1 cursor static for
      select name from master..sysdatabases 
      where left(name,3) in ('ADM','ENT','DEM')
      order by name asc

What is the functionality of ‘master..sysdatabases ‘? What is the equivalent syntax for master..sysdatabases in MySQL?

Answer

what is the functionality of ‘master..sysdatabases ‘?

SQL server divides databases into

1.User databases
2.System databases..

User database are the ones which users created,system databases(master,model,tempdb,msdb )are the one which comes with SQL installation..

In this case,user is trying to query all available database names matching them with string functions..

In MYSQL,you can use this..

select * from information_schema.SCHEMATA

http://dev.mysql.com/doc/refman/5.7/en/schemata-table.html

We are here to answer your question about ‘master..sysdatabases’ SQL Server syntax equivalent in MySQL - If you find the proper solution, please don't forgot to share this with your team members.

Related Posts

Tutorial Guruji