A computer can have one or more than one instance of SQL Server installed. Each instance of SQL Server can contain one or many databases. Within a database, there are one or many object ownership groups called schemas. Within each schema there are database objects such as tables, views, and stored procedures. Some objects such as certificates and asymmetric keys are contained within the database, but are not contained within a schema.
I've made some updates to standardized database restore solution. Latest version is already available on my GitHub profile. New feature is preserving permissions settings after database restore. Your current database...
This is risky! Be aware of doing this on some production database. This script is published for training purposes only. Use it with caution, this will definitely break your database,...
Standardized database restore solution. Doing some pre-restore checks and post-restore configurations with restored database. Is is also possible to restore databases that are part of Availability Group and joining them...
Bulk shrink of transaction log for all databases. This script is handy when your transaction logs grown big on several databases. You want to shrink all log files quickly so...
Examine performance of particular data files for all databases. Useful when troubleshooting performance of your SQL Server. Latency is one of the main performance counters measuring IO performance for SQL...
Looks for auto-growth events in default SQL Server trace. You can find this information in SSMS built-in database standard report Disk usage under charts. This part of report is available...
Switch recovery model to SIMPLE for all databases in loop. This simple cursor query is useful when you need to keep your transactions log maintained automatically by SQL Server. And...
Set database to SINGLE_USER mode do something and set MULTI_USER mode. Alter database mode using simple T-SQL statements....
Set database to read only mode do something and set read write mode. Alter database mode using simple T-SQL statements....
Generate script for changing mode for multiple databases. In given script I'm setting databases to Single-user and back to normal stace. Then changing state to Read-Only and back to Read-Write,...