Holen Sie sich Tabellen in der Datenbank SQL
SELECT
*
FROM
INFORMATION_SCHEMA.TABLES;
MelCode
SELECT
*
FROM
INFORMATION_SCHEMA.TABLES;
-- note for Microsoft SQL Server
-- getting tables in database you are working with
DECLARE @dbname AS varchar(max)
SET @dbname = (SELECT DB_NAME())
SELECT TABLE_NAME
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_TYPE = 'BASE TABLE' AND TABLE_CATALOG=@dbname
-- getting tables in specific database
DECLARE @dbname AS varchar(max)
SET @dbname = 'my specific database name'
SELECT TABLE_NAME
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_TYPE = 'BASE TABLE' AND TABLE_CATALOG=@dbname