• sp_msforeachdb also doesnt take into account certain characters in the DB Name, so it wont work as intended if such characters exist. The methods advised of going through sys.databases and using Quotename gets around this issue.