sqlserver
SQL Server Information Schema Queries
sqlserverQuery all tables in a database 1 2 3 SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE' AND TABLE_CATALOG='mydatabase'
SQL Server Create Database
sqlserverCreate database and user with fill rights 1 2 3 4 5 CREATE DATABASE [example]; CREATE LOGIN [example] WITH PASSWORD=N'MySecurePassword', DEFAULT_DATABASE=[master], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF; USE [example] CREATE USER [example] FROM LOGIN [example]; exec sp_addrolemember 'db_owner', 'example' Drop database (AWS RDS Multi A-Z) 1 2 USE [master] EXECUTE msdb.dbo.rds_drop_database N'example'