Graph multiple databases growth using SSMS only
Easily graph your storage needs based on msdb backup data recorded automatically, no matter what your backup solution is.
2020-03-17 (first published: 2020-03-10)
1,714 reads
Easily graph your storage needs based on msdb backup data recorded automatically, no matter what your backup solution is.
2020-03-17 (first published: 2020-03-10)
1,714 reads
This script will find all orphaned users on all databases on an instance, and generate a script to drop each user. Simply execute, copy the values from the DropScript column to a new SSMS window and execute. There are two risks with this script. Use with caution: This script attempts to take into account users […]
2020-03-16 (first published: 2020-03-13)
1,390 reads
The script searches through every column of every record in a database to find a value. It works with numbers too. Simply assign a value to @MyString. Indicate what datatype(s) you wish to search through, and indicate if you want wildcards, and execute. The search is smart and will only search through columns where @MyString is […]
2020-03-05 (first published: 2020-03-02)
1,184 reads
This script finds auto created statistics that duplicate existing stats generated by indexes, and may help to speed up your statistics maintenance. Copy the results from the DropScript column to a new SSMS tab and execute.
2020-02-21
532 reads
Dropping database in RDS follows different method than dropping the database in local SQL Server. Below is the command to DROP the database in Amazon RDS EXECUTE msdb.dbo.rds_drop_database N'demodb' GO However when the SQL Server is configured with Multi-zone mirroring, then you need to set the partner to OFF and drop all active connections and […]
2020-01-17
3,833 reads
2019-12-20 (first published: 2019-12-10)
2,116 reads
T-SQL script to purge all the tables including foreign key references. The script has been made smart enough to use TRUNCATE wherever there is no foreign key reference and to use DELETE wherever there is foreign key reference.
2019-12-10
2,619 reads
An alternative for Microsoft's STRING_SPLIT function that will work on SQL Server 2012 and higher.
2019-12-05 (first published: 2019-02-28)
26,342 reads
This script converts hierarchical adjacency into nested json rows which contain the recursive "downlines" of each node. The table-valued function treats each row in the original adjacency as the root node in a recursive common table expression.
2019-11-24
829 reads
I am teaching a database class at Queens College. The project entails the truncation of all of the data and loading new data into the existing database "BIClass" from a single of the flattened data. One of the tasks of the project was to add these three additional columns to each of the tables (AlterTableAddColumnsUserAuthorizationKeyAndTwoTimeStamps): […]
2019-11-18 (first published: 2019-11-10)
1,025 reads
No two SQL Server environments are alike. A fix that resolves a performance issue...
By ReviewMyDB
My T-SQL Tuesday #201 invitation. Do temp tables help performance or hurt it? I...
By Steve Jones
I have been experimenting with MCP servers in a few ways, and pressing on...
A new thread for testing the spam filter. Adding a link: https://www.bbc.co.uk/weather
Hello experts, An application team has asked us to modify a SQL Agent job....
Comments posted to this topic are about the item Advanced T-SQL: Replacing Slow Cursors...